JWT
This section describes how to generate a JWT in Make
Last updated
This section describes how to generate a JWT in Make
Last updated
There's no dedicated JWT connection type because the JWT itself is only a "special format" of the Authorization header. Everything works the same way as described in Basic Connection chapter.
The options argument refers to the same options object as in the npm library.
To generate the token, you can use the following example.
As you can see in the example, first, we build a JWT payload inside the temp
variable called jwt
, but you can use any other name for that variable.
Then, inside the Authorization header, we call the IML function named jwt
. The jwt
function accepts four parameters:
The payload to be signed.
The secret to signing the payload.
The algorithm. The supported algorithms are HS256
, HS384
, HS512
, and RS256
. The default value is HS256
. This parameter is optional.
A custom header to customize the JWT authorization header. This parameter is optional.
This function will output a JWT token which you can use in the Authorization header.