Skip to main content

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