Skip to navigation

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

View as Markdown

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), 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 for your own key or Jwks Auth for a Moveworks-managed one.

Before you begin

  • Start creating an HTTP 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:

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.

Field NameField Value
Jwt Grant Private KeyUpload 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 AlgorithmRequired, with nothing selected by default. Select from HS256, RS256, or ES256.
Jwt Grant Claims Expiry SecondsThe expiration time in seconds. The exp claim is calculated as iat + this value.
Jwt Grant Claims IssuerThe iss claim value.
Jwt Grant Claims AudienceThe aud claim value, as the provider specifies.
Jwt Grant Claims SubjectThe sub claim value. To carry each employee’s identity, use a template such as {{ user.email_addr }}.
Enable JTI claimSelect it to include a unique jti claim in each generated token.
Jwt Grant HeadersAny additional header claims, such as typ or kid.
Jwt Grant Additional ClaimsAny 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.

Fill in the token request fields

FieldWhat to enter
Oauth2 Token UrlThe full token URL.
Oauth2 Custom Oauth Response Response TypeMoveworks 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 HeadersOptional. 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 DataOptional. 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:

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:

{
"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:

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 that uses it. To check the JWT itself, decode it at JWT.io and compare its claims with what the provider expects.