Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Methods SummaryCreate a JSON Web Token for the given payload that is signed with the (shared) secret key 'jwt.Create a JSON Web Token for the given payload that is signed with the (shared) secret key 'jwt.Verifiy a JWTtoken that is created with the #create(Object) method.

functionservoy sDetail2100%height:30px2Methods Detailscreatename

create(payload)

dessIndent
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.
prs

Parameters

sIndentpayloada json containing the data, e.g. {'some': 'data', 'somemore': 'data2'}
ret

Returns

sIndent a string representing the encrypted data or null if the token cannot be generated
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowcreatename

create(payload, expiresAt)

dessIndent
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.
prs

Parameters

sIndentpayloada json containing the data, e.g. {'some': 'data', 'somemore': 'data2'}expiresAtthe date when the created token expires, after the expired date the token won't be verified
ret

Returns

sIndent a string representing the encrypted data or null if the token cannot be generated
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
verifyname

verify(token)

dessIndent
Verifiy a
JWT
 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.
prs

Parameters

sIndenttokena JSON Web Token
ret

Returns

sIndent the payload or null if the token can't be verified
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow