Apr 24, 2024 19:09 Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients SampleSupported Clients
SmartClient
WebClient
NGClient
Methods Summary
Builder
header(key, value)
Adds a header to the JWT token.
Builder
payload(payload)
Adds the payload (claims) to the web token.
String
sign(alg)
Sign the token with the given algorithm.
Builder
withClaim(key, value)
Adds data to the payload, which contains the claims.
Builder
withExpires(expire)
Add a specific Expires At ("exp") claim to the Payload.
Methods Details
header(key, value)
Adds a header to the JWT token.
String
key
a string representing the header name
String
value
can be a string
payload(payload)
Adds the payload (claims) to the web token.
Object
payload
a json containing the data,
e.g. {'some': 'data', 'somemore': 'data2'}
sign(alg)
Sign the token with the given algorithm.
The 'alg' claim is automatically added to the token header.
Algorithm
alg
the algorithm used to sign the token.
withClaim(key, value)
Adds data to the payload, which contains the claims.
Claims are statements about an entity (typically, the user) and additional data.
String
key
a string representing the claim name (e.g. 'iss' which stands for issuer; 'email', 'name', etc.)
Object
value
can be a string, a boolean, a date, a number or an array
withExpires(expire)
Add a specific Expires At ("exp") claim to the Payload.
Date
expire
a date representing the expiration time of the token