Documentation

JWT Generation

A JWT (JASON Web Token) is basically a JSON object, signed via a Keyed-Hash Message Authentication Code (HMAC). Here’s an example of how a JWT looks like, you can use the website https://jwt.io:

 

JWT Example

 

In the headers we just need to indicate the type of the token, JWT in this case and the encryption algorithm HS256.

 

In the payload these 4 attributes are mandatory:

 

{

"iss": "anyName",            //can be your organization name

"jti": "uniqueIdentifier",   //any id

"aud": "",                   //must present and empty

"sub": "user@customer.com"   //user who is going to log in

}

 

This is how it looks after encryption:

 

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJPcmdhbml6YXRpb25OYW1lIiwianRpIjoidW5pcXVlSWRlbnRpZmllciIsImF1ZCI6IiIsInN1YiI6InVzZXJAY3VzdG9tZXIuY29tIn0.yZK519LFvGOvQwjwiZ7UAXKSA_Mbqtc4Dd0oD_kuog8

 

In order to generate a valid JWT, we suggest using one of the opensource libraries available at https://jwt.io. They are provided for free and for multiple programming languages.

 

To see a sample integration project in Java, please navigate to this public repository: https://github.com/datamint/SSOsample.