---
schema_version: "1"
id: 5e2291e5786dd9d7074bc16d22556b160cdba5e94409a6b3950d635ee603198c
title: OAuth2TokenExchangeType Enum
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_enum_Auth_OAuth2TokenExchangeType.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_Auth_OAuth2TokenExchangeType.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1b7837348be7519669e7394b26456b6d7c65cfa3f54c3b293d213b9ab790d4f9
description: Used during the OAuth 2.0 token exchange flow to specify the type of token that’s being exchanged for a Salesforce token.
---
# OAuth2TokenExchangeType Enum

Used during the OAuth 2.0 token exchange flow to specify the type of token that’s being exchanged for a Salesforce token.

## Usage

During the token exchange flow, your app requests a token from Salesforce by sending a POST request with a token from an external identity provider. The request includes a subject\_token\_type parameter to specify the type of token. The values specified in this enum must correspond to the subject\_token\_type in the token request.

## Enum Values

The following are the values of the Auth.OAuth2TokenExchangeType enum.

| Value | Description |
| --- | --- |
| ACCESS\_TOKEN | An access token from the identity provider. The corresponding subject\_token\_type is urn:ietf:params:oauth:token-type:access\_token. |
| ID\_TOKEN | An ID token from the identity provider. The corresponding subject\_token\_type is urn:ietf:params:oauth:token-type:id\_token. |
| JWT | A token from the identity provider that’s formatted as a JSON Web Token (JWT). The corresponding subject\_token\_type is urn:ietf:params:oauth:token-type:JWT. |
| REFRESH\_TOKEN | A refresh token from the identity provider. The corresponding subject\_token\_type is urn:ietf:params:oauth:token-type:refresh\_token. |
| SAML\_2 | A SAML 2.0 assertion from the identity provider. The corresponding subject\_token\_type is urn:ietf:params:oauth:token-type:saml2. |