May 01, 2024 14:51 Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients SampleSupported Clients
SmartClient
WebClient
NGClient
Methods Summary
String
create(payload)
Create a JSON Web Token for the given payload that is signed with the (shared) secret key 'jwt.
String
create(payload, expiresAt)
Create a JSON Web Token for the given payload that is signed with the (shared) secret key 'jwt.
Object
verify(token)
Verifiy a token that is created with the #create(Object) method.
Methods Details
create(payload)
Create a JSON Web Token for the given payload that is signed with the (shared) secret key 'jwt.secret.password' that has to be configured on the admin page for this plugin.
The payload can be for example a user:username of the current user, so that with this token if it verifies with the same secret key you can assume it is the same user that wants to login.
Object
payload
a json containing the data,
e.g. {'some': 'data', 'somemore': 'data2'}
create(payload, expiresAt)
Create a JSON Web Token for the given payload that is signed with the (shared) secret key 'jwt.secret.password' that has to be configured on the admin page for this plugin.
The payload can be for example a user:username of the current user, so that with this token if it verifies with the same secret key you can assume it is the same user that wants to login.
The expiresAt makes sure this token is only valid until that date.
Object
payload
a json containing the data,
e.g. {'some': 'data', 'somemore': 'data2'}
Date
expiresAt
the date when the created token expires,
after the expired date the token won't be verified
verify(token)
Verifiy a token that is created with the #create(Object) method.
This will only verify and return the payload that was given if the token could be verified with the (shared) secrect key 'jwt.secret.password' that is configured on the admin page.
Will also return null if the token passed its expire date.
String
token
a JSON Web Token