JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained method for the secure transmission of information between two parties as a JSON object. This information can be verified and trusted since the token is digitally signed.
JWTs can be signed by using a secret (with the HMAC algorithm) or a pair of public/private keys using RSA.
To read more about it, access this website: https://jwt.io/.
NOTEBefore we make the call to generate the JWT token, we need to make a call to generate the Authorization Code. To know how to generate it, click here.
To use this interceptor, an app must have been created, so that we can access the client ID and client secret.
To generate the JWT, it is necessary to make a POST request to the endpoint <gateway url>/oauth/access-token.
The header should contain the following information:
NOTEThe
client_id:client_secretmust be a string converted to Base64, using the app data.
Here is an example of a header with the client ID and secret converted to Base64:
In the body, we must inform the "code" generated by the grant-code endpoint, with a few more items in the format x-www-form-urlencoded:
NOTEIn addition to generating a JWT, you can also create an encrypted token using the JWE (JSON Web Encryption) standard. To learn how to generate a JWE and protect the token content with encryption, see JWE (JSON Web Encryption).
Lastly, your access token will be generated again and should appear as the example below:
NOTEIf your API returns the status code
401 Unauthorizedwhen using this interceptor, the token may be invalid. See more details on this page of our FAQs.
This interceptor can only be inserted in the request flow and two pieces of information need to be configured: Location and Name.
Location options are:
The property "Name" defines the expected query param name.

The property "Name" defines the expected header name.

In this case, there is no property "Name"; the JWT is expected in the header Authorization.

As we mentioned in the beginning of this page, JWT is a pattern that allows transmitting tokens from one party to another with security regarding the legitimacy of the token sent. It is usual for this pattern to be used to send additional information via "claims".
However, it's important to remember that JWT is a pattern that ensures data reliability, not confidentiality. Sensitive information transmitted in the body of the token can be intercepted and exposed.
The JWE (JSON Web Encryption) adds an extra layer of security to the token by encrypting the transmitted data. This allows you to extend the functionality of JWT so that, in addition to ensuring authenticity and integrity, it also guarantees the confidentiality of the transmitted information.
When the Use JWE β JSON Web Encryption option is enabled, the encrypted token in the request is validated, decrypted, and then forwarded to the backend. This process ensures that only authorized systems can access the token's content, reinforcing end-to-end security in the communication between the parties.

To correctly execute the flow, you must have:
NOTEMake sure that the OAuth 2.0 API is available in your environment. If not, you'll need to create it before proceeding.
The next steps depend on the requirements above. Ensure that all prerequisites are completed before continuing.
The JWE generation process involves two main steps:
Generating a grant code is an essential step to create the JWE.
Send a POST request to the /oauth/grant-code endpoint of the OAuth API, as shown in the example below:
Request
Replace:
<app_client_id> with the value of your application's client_id.<redirect_url> with the desired redirect URL.<gateway_url> with the gateway address for your environment.Response
After sending the request, a response containing the "redirect_uri" will be returned.
Copy the "code" value, as it will be required in the next step.
CAUTIONThe API must include an OAuth interceptor with the JWT option enabled. Otherwise, a bad request error will occur, indicating that the grant type is invalid.
Example response
With the obtained code, it's time to generate the JWE. See the example request below.
Request
IMPORTANTThe
encrypt=trueparameter is mandatory for the token to be generated in the JWE (JSON Web Encryption) format. Without this parameter, the token will be issued as a JWT without encryption, exposing the information in the payload.
NOTEIn the example above:
- The
codeparameter must contain the value obtained in the previous step.- The
encrypt=trueparameter indicates that the token is being transmitted with JWE β JSON Web Encryption enabled.
Adjust the example as needed:
Authorization header with your App's Base64 code;encrypt=true parameter;<gateway_url> with your environment's gateway URL.NOTEThe request must be sent in x-www-form-urlencoded format.
Response
Copy the value of the access_token field. This is your JWE.
NOTEThe use of JWE follows the same pattern as JWT. For more details, see the topic JWT (JSON Web Token).
To confirm that the token was indeed encrypted, you can use the JWT Debugger.
You'll notice that the token's content is unreadable, confirming that encryption was applied.
To validate the Use JWE β JSON Web Encryption option:
Send a request to your API, including the App's client_id and the generated access_token (JWE).
In the API's destination field, use a mock that allows you to visualize the decrypted access_token β for example, Supermock Sensedia.
Request example
After execution, the backend will receive the already decrypted token, allowing you to validate the complete flow of the Use JWE β JSON Web Encryption feature.
Partial response example
We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more