Search

 

Module:Editor

Version:23.03 +

Type:String

Category:Text

 

Description

The formula 'ValidateJWT' validates a JWT token based on a algorithm. We support both symmetric algorithms, where the JWT tokens are validated using a secret key and asymmetric algorithms where the tokens are validated using a public key.

Futurama currently supports the following algorithms:

Symmetric algorithms:

  • HS256
  • HS384
  • HS512

Asymmetric algorithms:

  • RS256
  • RS384
  • RS512

Parameters

Algorithm:

The algorithm to use for the validation. The available options are HS256, HS384, HS512, RS256, RS384 and RS512. If not specified, the formula selects the algorithm from the JWT token.

Token:

The JWT token that needs to be validated.

Key:

The key to validate the JWT token. For a symmetric algorithm this should be a secret key and for a asymmetric algorithm this should be the public key.

Example

Description

In this example the formula 'ValidateJWT' is used to validate a JWT token with the algorithm HS256. The formula will return the token content.

Values Parameters

Algorithm:

HS256

Token:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkhTMjU2In0.eyJuYW1laWQiOiJIUzI1NiIsIm5iZiI6MTY3ODM3OTc2MSwiZXhwIjox OTc4OTg0NTYxLCJpYXQiOjE2NzgzNzk3NjEsImlzcyI6Imh0dHA6Ly9IUzI1Ni5jb20iLCJhdWQiOiJodHRwOi8vSFMyNTYuY29tIn0.ezRGKBpl-Mg6APFazhw7iAkTxSJewoZhlaJFcH2X8mM

Key:

test1234test1234

Result

Result:

{"alg":"HS256","typ":"JWT","kid":"HS256"}.{"nameid":"HS256","nbf":1678379761,"exp":1978984561,"iat":1678379761,"iss":"http://HS256.com","aud":"http://HS256.com"}

Updated: 2023-04-06