This endpoint returns access tokens, ID tokens, and refresh tokens depending on the request parameters. For password, client credentials, SAML 2.0 assertion, and refresh token flows, calling /token is the only step of the flow. For the authorization code flow, calling /token is the second step of the flow.
Note: The
/tokenendpoint requires client authentication. The method is configured per client app. See Client authentication methods.
Determines the mechanism Okta uses to authorize the creation of the tokens
The value is what was returned from the authorization endpoint. The code has a lifetime of 300 seconds.
Required if the code_challenge was specified in the original /authorize request. This value is the code verifier for PKCE. Okta uses it to recompute the code_challenge and verify if it matches the original code_challenge in the authorization request.
- authorization_code
- client_credentials
- password
- refresh_token
- urn:ietf:params:oauth:grant-type:saml2-bearer
- urn:ietf:params:oauth:grant-type:token-exchange
- urn:ietf:params:oauth:grant-type:device_code
- urn:openid:params:grant-type:ciba
- urn:okta:params:oauth:grant-type:otp
- urn:okta:params:oauth:grant-type:oob
- http://auth0.com/oauth/grant-type/mfa-otp
- http://auth0.com/oauth/grant-type/mfa-oob
- Authorization Code Flow w/ Client Credentials
- SAML Bearer
- Resource Owner Password Flow
- Direct authentication with OTP (primary factor)
- Direct authentication with OTP (MFA)
- Direct authentication with OOB (primary factor)
- Direct authentication with OOB (MFA)
- Identity Assertion JWT Authorization Grant
- OPA vaulted secret for AI agent
- OPA service account for AI agent
- OAuth STS for AI agent
curl -i -X POST \
https://okta-subdomain.pixtulate.com/oauth2/v1/token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d client_id=0jrabyQWm4B9zVJPbotY \
-d client_secret=6W7XvLCrs4ByKn7Ucwh8ygeeXRhdGFdVOTp75eOc \
-d grant_type=authorization_code \
-d redirect_uri=https://www.example.com/oauth2/redirectUri \
-d 'code=QnowT-aeawtOJKp-MtkH&'Based on the scopes requested. The scopes specified in a request are included in the access token in the response.
An opaque refresh token. This is returned if the offline_access scope is granted.
The token type in a /token response. The value is generally Bearer except for a few instances of token exchange.
The type of token for token exchange
| Enum Value | Description |
|---|---|
| urn:ietf:params:oauth:token-type:access_token | OAuth 2.0 access token |
| urn:ietf:params:oauth:token-type:id_token | ID token |
| urn:ietf:params:oauth:token-type:jwt | JSON Web Token (JWT) |
| urn:ietf:params:oauth:token-type:refresh_token | OAuth 2.0 refresh token |
| urn:ietf:params:oauth:token-type:saml1 | SAML 1.1 assertion |
| urn:ietf:params:oauth:token-type:saml2 | SAML 2.0 assertion |
| urn:okta:oauth:token-type:web_sso_token | Web SSO token |
| urn:x-oath:params:oauth:token-type:device-secret | Device secret |
| urn:okta:params:oauth:token-type:interclient_token | Interclient token |
| urn:ietf:params:oauth:token-type:id-jag | Identity Assertion JWT Authorization Grant (ID-JAG). This type is only available with Cross App Access or if you're subscribed to Okta for AI Agents. |
| urn:okta:params:oauth:token-type:vaulted-secret | OPA vaulted secret. This type is only available if you're subscribed to Okta for AI Agents. |
| urn:okta:params:oauth:token-type:service-account | OPA service account. This type is only available if you're subscribed to Okta for AI Agents. |
| urn:okta:params:oauth:token-type:oauth-sts | OAuth Security Token Service (STS). This type is only available if you're subscribed to Okta for AI Agents. |
The service account credentials. This is returned if the issued_token_type is urn:okta:params:oauth:token-type:service-account.
Note: This is only available if you're subscribed to Okta for AI Agents. Contact Okta Support for more information.
The vaulted secret containing key-value pairs. This is returned if the issued_token_type is urn:okta:params:oauth:token-type:vaulted-secret.
Note: This is only available if you're subscribed to Okta for AI Agents. Contact Okta Support for more information.
- Token response
- Identity Assertion JWT Authorization Grant
- OPA vaulted secret for AI agent
- OPA service account for AI agent
- OAuth STS for AI agent
{ "access_token": "<access_token_value>", "token_type": "Bearer", "expires_in": 3600, "scope": "openid email offline_access", "refresh_token": "a9VpZDRCeFh3Nkk2VdY", "id_token": "<id_token_example>" }