@@ -25,6 +25,7 @@ interface
25
25
26
26
uses
27
27
System.SysUtils,
28
+ System.Rtti,
28
29
JOSE.Types.Bytes,
29
30
JOSE.Core.Base,
30
31
JOSE.Core.Parts,
@@ -67,6 +68,7 @@ TJOSEProducer = class(TInterfacedObject, IJOSEProducer)
67
68
function SetJWTId (const AValue: string): IJOSEProducerBuilder;
68
69
function SetNotBefore (AValue: TDateTime): IJOSEProducerBuilder;
69
70
function SetSubject (const AValue: string): IJOSEProducerBuilder;
71
+ function SetCustomClaim (const AName: string; const AValue: TValue): IJOSEProducerBuilder;
70
72
71
73
function SetKey (const AKey: TJOSEBytes): IJOSEProducerBuilder;
72
74
function SetKeyPair (const APublicKey, APrivateKey: TJOSEBytes): IJOSEProducerBuilder;
@@ -97,6 +99,7 @@ TJOSEProducerBuilder = class(TInterfacedObject, IJOSEProducerBuilder)
97
99
function SetJWTId (const AValue: string): IJOSEProducerBuilder;
98
100
function SetNotBefore (AValue: TDateTime): IJOSEProducerBuilder;
99
101
function SetSubject (const AValue: string): IJOSEProducerBuilder;
102
+ function SetCustomClaim (const AName: string; const AValue: TValue): IJOSEProducerBuilder;
100
103
101
104
function SetKey (const AKey: TJOSEBytes): IJOSEProducerBuilder;
102
105
function SetKeyPair (const APublicKey, APrivateKey: TJOSEBytes): IJOSEProducerBuilder;
@@ -217,6 +220,12 @@ function TJOSEProducerBuilder.SetAudience(const AValue: TArray<string>): IJOSEPr
217
220
Result := Self;
218
221
end ;
219
222
223
+ function TJOSEProducerBuilder.SetCustomClaim (const AName: string; const AValue: TValue): IJOSEProducerBuilder;
224
+ begin
225
+ GetJWT.Claims.SetClaim(AName, AValue);
226
+ Result := Self;
227
+ end ;
228
+
220
229
function TJOSEProducerBuilder.SetExpiration (AValue: TDateTime): IJOSEProducerBuilder;
221
230
begin
222
231
GetJWT.Claims.Expiration := AValue;
0 commit comments