> For the complete documentation index, see [llms.txt](https://developers.make.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.make.com/custom-apps-documentation/app-components/connections/jwt.md).

# JWT

There's no dedicated JWT connection type because the JWT is a special format of the Authorization header. See the [basic connection](/custom-apps-documentation/app-components/connections/basic-connection.md) section for more information.

## Generating a JWT

To generate the token, use the following code:

{% tabs %}
{% tab title="Code example" %}

```json
{
  "url": "https://mock.api/connect",
  "temp": {
    "jwt": {
      "iss": "https://iam.the.issu.er",
      "iat": "{{timestamp}}",
      "exp": "{{timestamp + 30000}}",
      "scope": ["rest_webservices"],
      "aud": "https://iam.the.audien.ce/services/rest/auth/oauth2/v1/token"
      },
    "options": {
      "header": {
        "kid": "{{parameters.clientId}}"
	}
      }
    },
    "headers": {
      "authorization": "Bearer {{jwt(temp.jwt, parameters.clientSecret, 'HS512', temp.options)}}"
    }
}
```

{% hint style="info" %}
The options argument refers to the same options object as in the [npm library](https://www.npmjs.com/package/jsonwebtoken).
{% endhint %}
{% endtab %}
{% endtabs %}

In this example, you can build a JWT payload inside the `temp` variable called `jwt`.

Inside the Authorization header, call the IML function named `jwt`. The `jwt` function accepts four parameters:

1. The **payload** to be signed.
2. The **secret** to sign the payload.
3. The **algorithm**. The supported algorithms are `HS256`, `HS384`, `HS512`, and `RS256`. The default value is `HS256`. This parameter is optional.
4. 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.make.com/custom-apps-documentation/app-components/connections/jwt.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
