decodeJWT
Decodes a JSON Web Token (JWT).
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"params" (required) | Object | undefined | null |
Parameters
Key | Type | Description | Default Value |
---|---|---|---|
"async" | Boolean | Specifies whether the action should perform asynchronously. | null |
"checkDate" | Boolean,String | Determines whether to check if the JWT is still valid. | false |
"jwt" (required) | String | The JWT to decode. | null |
"onError" (required) | String | The event that is fired if the JWT was not decoded. | null |
"onErrorType" | OnErrorType | Type of event that will be fired on error. | null |
"onSuccess" (required) | String | The event that is fired if the JWT was decoded. | null |
"onSuccessType" | OnSuccessType | Type of event that will be fired on success. | null |
Inherited
From Base Action
Base Action
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"dynamicParams" | Object | Dynamic params to retrieve data from a specific context e.g. a userSetting. | null |
"leadingDelimiter" | String | The leading mustache delimiter to use. | null |
"params" | Object,Array | Object containing the properties of the action. | null |
"trailingDelimiter" | String | The trailing mustache delimiter to use. | null |
"type" | String | Type name of the action. | null |
Examples
Example 1: Decode a JWT
Goal: Create a deocdeJWT action checking whether the JWT is still valid.
To achieve this the following code can be used:
{
"type": "decodeJWT",
"params": {
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkZhYnJpazE5IiwiaWF0IjoxNTE2MjM3MDMyfQ.vDEuhpyybuEF6x9ZGLWpzAo9Vg43hiZzU5ecEZP4_S8",
"checkDate": true,
"onSuccess": "decodeJWTSuccess",
"onError": "decodeJWTError"
}
}
The checkDate
parameter specifies whether the JWT is checked for validity.
Result:
A decodeJWT action has been created.