Skip to main content
Version: 4.62

decodeJWT

Decodes a JSON Web Token (JWT).

Field Configurations

KeyTypeDescriptionDefault Value
"params" (required)Objectundefinednull

Parameters

KeyTypeDescriptionDefault Value
"async"BooleanSpecifies whether the action should perform asynchronously.null
"checkDate"Boolean,StringDetermines whether to check if the JWT is still valid.false
"jwt" (required)StringThe JWT to decode.null
"onError" (required)StringThe event that is fired if the JWT was not decoded.null
"onErrorType"OnErrorTypeType of event that will be fired on error.null
"onSuccess" (required)StringThe event that is fired if the JWT was decoded.null
"onSuccessType"OnSuccessTypeType of event that will be fired on success.null

Inherited

From Base Action

Base Action

Field Configurations

KeyTypeDescriptionDefault Value
"dynamicParams"ObjectDynamic params to retrieve data from a specific context e.g. a userSetting.null
"leadingDelimiter"StringThe leading mustache delimiter to use.null
"params"Object,ArrayObject containing the properties of the action.null
"trailingDelimiter"StringThe trailing mustache delimiter to use.null
"type"StringType name of the action.null

Examples

Example 1: Decode a JSON Web Token

Show ExampleHide Example

Decode the user's access token and check whether it is still valid.

{
"type": "decodeJWT",
"leadingDelimiter": "{$",
"trailingDelimiter": "$}",
"dynamicParams": {
"AccessToken": {
"context": "userSetting",
"field": "accessToken"
}
},
"params": {
"jwt": "{$accessToken$}",
"checkDate": true,
"onSuccess": "accessTokenSuccess",
"onError": "accessTokenError"
}
}

The checkDate param specifies whether the JWT is checked for validity.