> This page is for Tools.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.moveworks.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.moveworks.com/_mcp/server.

# Set up the OAuth 2.0 JWT bearer grant for an HTTP connector

> Configure an HTTP connector's Jwt Grant or Jwks Grant to exchange a signed JWT for an OAuth 2.0 access token with the RFC 7523 JWT bearer grant.

**OAuth 2.0.** The Jwt Grant and Jwks Grant sign a JWT and exchange it at the provider's token URL for an access token, using the standard OAuth 2.0 JWT bearer grant ([RFC 7523](https://www.rfc-editor.org/rfc/rfc7523)), `urn:ietf:params:oauth:grant-type:jwt-bearer`. Provider docs usually name this grant type when they support it. If the provider asks for `client_assertion` and `client_assertion_type` instead, that's JWT client authentication (RFC 7523 §2.2), not this grant. Use the **Jwt Grant** to sign with your own private key, or the **Jwks Grant** to sign with a Moveworks-managed key that rotates automatically.

> **Looking for direct JWT auth?**
>
> If the API takes the signed JWT itself and there's no token URL, use [Jwt Auth](/tool-studio/connectors/http-connectors/jwt-auth) for your own key or [Jwks Auth](/tool-studio/connectors/http-connectors/jwks-auth) for a Moveworks-managed one.

## Before you begin

* Start [creating an HTTP connector](/tool-studio/connectors/http-connectors#create-the-connector) and fill in its details up to **Auth Config**.
* Get the ***full*** token URL and the claims the provider expects (`iss`, `aud`, `sub`). For the Jwt Grant, have your private key or secret ready.

## Choose the grant and enter the JWT fields

1. Select **Oauth2** from the **Auth Config** dropdown.
2. Set **Oauth2 Grant Type** to **Jwt Grant** or **Jwks Grant**, then fill in its fields:

#### Jwt Grant

The Jwt Grant signs the JWT with your private key or secret.

![Auth Config set to Oauth2 and Oauth2 Grant Type set to Jwt Grant, with the Jwt Grant Private Key upload, Key ID (Optional) and the required Jwt Grant Algorithm fields below.](/_fern-files/_img/50ed3cfeb0dea98c893a7f97fc90cd49f1ae0858eebfa9fd8edeb4e141cee980.webp)

| Field Name                          | Field Value                                                                                               |
| :---------------------------------- | :-------------------------------------------------------------------------------------------------------- |
| **Jwt Grant Private Key**           | Upload your Private Key or 256-bit secret, as a file under 10 KB.                                         |
| **Key ID (Optional)**               | Leave blank. To send a `kid` header, add it under **Jwt Grant Headers** instead.                          |
| **Jwt Grant Algorithm**             | Required, with nothing selected by default. Select from HS256, RS256, or ES256.                           |
| **Jwt Grant Claims Expiry Seconds** | The expiration time in seconds. The `exp` claim is calculated as `iat` + this value.                      |
| **Jwt Grant Claims Issuer**         | The `iss` claim value.                                                                                    |
| **Jwt Grant Claims Audience**       | The `aud` claim value, as the provider specifies.                                                         |
| **Jwt Grant Claims Subject**        | The `sub` claim value. To carry each employee's identity, use a template such as `{{ user.email_addr }}`. |
| **Enable JTI claim**                | Select it to include a unique `jti` claim in each generated token.                                        |
| **Jwt Grant Headers**               | Any additional header claims, such as `typ` or `kid`.                                                     |
| **Jwt Grant Additional Claims**     | Any extra payload claims, such as `scope`. Values are sent as strings.                                    |
| **Assertion Key (optional)**        | The body key for the JWT, if the provider doesn't use the standard `assertion`.                           |

#### Jwks Grant

The Jwks Grant signs the JWT with a Moveworks-managed RSA key, and the provider verifies it at your org's JWKS URL. Its fields match [Jwks Auth](/tool-studio/connectors/http-connectors/jwks-auth#configure-jwks-auth), with **Jwks Grant** in place of **Jwks Auth** in each label, starting with **Generate JWKS** under **Jwks Grant Jwks**. Set **Assertion Key (optional)** if the provider doesn't use the standard `assertion`. Then [give the provider your JWKS URL](/tool-studio/connectors/http-connectors/jwks-auth#give-the-api-your-jwks-url).

![Auth Config set to Oauth2 and Oauth2 Grant Type set to Jwks Grant, with the Generate JWKS button under Jwks Grant Jwks and the rotation grace period and rotation interval fields below.](/_fern-files/_img/5eaf117857239e1ae3a42498b240223ed3fd7653b60279c4bc1111228c7ce1b9.webp)

## Fill in the token request fields

| Field                                                           | What to enter                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Oauth2 Token Url**                                            | The ***full*** token URL.                                                                                                                                                                                                                                                                                                                                                                                |
| **Oauth2 Custom Oauth Response Response Type**                  | Moveworks reads the token from `access_token` and the expiry from `expires_in` in a JSON response. **Text** isn't applied, so providers that return the token as plain text aren't supported. To read the token or expiry from different keys, select **Json** and set **Access Token Key (optional)** or **Expires In Key (optional)**.                                                                 |
| **Header Auth Key (Optional)**                                  | Leave blank to send the access token in the `Authorization` header.                                                                                                                                                                                                                                                                                                                                      |
| **Header Auth Value Pattern (Optional)**                        | Leave blank to send the access token as `Bearer <token>`, even though the form says it defaults to `%s`. If you enter a pattern, include `%s` where the token goes.                                                                                                                                                                                                                                      |
| **Custom Grant Type (Optional)**                                | Leave blank. The default for the selected grant is used.                                                                                                                                                                                                                                                                                                                                                 |
| **Oauth2 Custom Oauth Request Options Additional Headers**      | Optional. Extra headers for the token request, if the provider needs them. The connector's **Common headers (Optional)** and **Common query params (Optional)** aren't sent on the token request, so put anything the token endpoint needs here. To send the body as JSON, add an entry named `Content-Type` (exactly, case-sensitive) with the value `application/json` (exactly, with no `; charset`). |
| **Oauth2 Custom Oauth Request Options Additional Request Data** | Optional. Extra body fields for the token request, such as `scope` or `audience`, if the provider needs them. A key here replaces the standard value of the same name, such as `grant_type`. The exception is **Client Credentials Grant Scope**: when set, it wins over a `scope` here.                                                                                                                 |

These grants ignore **Oauth2 Custom Oauth Response Response Type**: the token is always read from `access_token` in a JSON response. Don't add an `assertion` key under Additional Request Data; it would be sent instead of the signed JWT.

Moveworks signs the JWT, exchanges it at the token URL for an access token, then sends the access token to the API. The token request sends the JWT and no client ID or client secret:

```shell
curl -X POST "$OAUTH2_TOKEN_URL" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -d "grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer" \
     -d "assertion=$jwt_token"
```

A successful response might look like this:

```json
{
    "access_token": "YOUR_ACCESS_TOKEN",
    "token_type": "Bearer",
    "expires_in": 3600
}
```

The system extracts `access_token` from this response and uses it for subsequent API requests:

```shell
curl -X GET "https://api.example.com/data" \
     -H "Authorization: Bearer $ACCESS_TOKEN"
```

## Save and confirm it works

Save the connector, then [test it from an action](/tool-studio/connectors/http-connectors#save-and-confirm-it-works) that uses it. To check the JWT itself, decode it at [JWT.io](https://jwt.io/) and compare its claims with what the provider expects.