---
schema_version: "1"
id: b0d0fa3488c45b1046cb8aac92d7453c2637cdc0f7cdbca420b26821d3151f38
title: AuthProviderTokenResponse Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_Auth_AuthProviderTokenResponse.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Auth_AuthProviderTokenResponse.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: c8c6add9e1fb77e12fea00926abc73d8422a3002545167cbde4f1179b91487d4
description: Stores the response from the AuthProviderPlugin.handleCallback method.Creates an instance of the AuthProviderTokenResponse class for a custom authentication provider plug-in using the specified arguments.Creates an instance of the AuthProviderTokenResponse class for a custom authentication provider plug-in using the specified arguments. This constructor includes a parameter for the ID token.The OAuth secret or refresh token for the currently logged-in user.The OAuth access token.The authentication provider.The state passed in to initiate the authentication request for the user.The ID token from the third party in encoded JWT format.
---
# AuthProviderTokenResponse Class

Stores the response from the AuthProviderPlugin.handleCallback method.

## Namespace

[Auth](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Auth.htm "The Auth namespace provides an interface and classes for single sign-on into Salesforce and session security management.")

- **[AuthProviderTokenResponse Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Auth_AuthProviderTokenResponse.htm#apex_Auth_AuthProviderTokenResponse_constructors)**
- **[AuthProviderTokenResponse Properties](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Auth_AuthProviderTokenResponse.htm#apex_Auth_AuthProviderTokenResponse_properties)**

## AuthProviderTokenResponse Constructors

The following are constructors for AuthProviderTokenResponse.

- **[AuthProviderTokenResponse(provider, oauthToken, oauthSecretOrRefreshToken, state)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Auth_AuthProviderTokenResponse.htm#apex_Auth_AuthProviderTokenResponse_ctor)**  
    Creates an instance of the AuthProviderTokenResponse class for a custom authentication provider plug-in using the specified arguments.
- **[AuthProviderTokenResponse(provider, oauthToken, oauthSecretOrRefreshToken, state, idToken)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Auth_AuthProviderTokenResponse.htm#apex_Auth_AuthProviderTokenResponse_ctor_2)**  
    Creates an instance of the AuthProviderTokenResponse class for a custom authentication provider plug-in using the specified arguments. This constructor includes a parameter for the ID token.

### AuthProviderTokenResponse(provider, oauthToken, oauthSecretOrRefreshToken, state)

Creates an instance of the AuthProviderTokenResponse class for a custom authentication provider plug-in using the specified arguments.

#### Signature

public AuthProviderTokenResponse(String provider, String oauthToken, String oauthSecretOrRefreshToken, String state)

#### Parameters

- **provider**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    The custom authentication provider.
- **oauthToken**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    The OAuth access token.
- **oauthSecretOrRefreshToken**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    The OAuth secret or refresh token for the currently logged-in user.
- **state**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    The state passed in to initiate the authentication request for the user.

### AuthProviderTokenResponse(provider, oauthToken, oauthSecretOrRefreshToken, state, idToken)

Creates an instance of the AuthProviderTokenResponse class for a custom authentication provider plug-in using the specified arguments. This constructor includes a parameter for the ID token.

#### Signature

public AuthProviderTokenResponse(String provider, String oauthToken, String oauthSecretOrRefreshToken, String state, String idToken)

#### Parameters

- **provider**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") The custom authentication provider.
- **oauthToken**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") The OAuth access token.
- **oauthSecretOrRefreshToken**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") The OAuth secret or refresh token for the currently logged-in user.
- **state**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") The state passed in to initiate the authentication request for the user.
- **idToken**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") The ID token in encoded JWT format.

## AuthProviderTokenResponse Properties

The following are properties for AuthProviderTokenResponse.

- **[oauthSecretOrRefreshToken](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Auth_AuthProviderTokenResponse.htm#apex_Auth_AuthProviderTokenResponse_oauthSecretOrRefreshToken)**  
    The OAuth secret or refresh token for the currently logged-in user.
- **[oauthToken](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Auth_AuthProviderTokenResponse.htm#apex_Auth_AuthProviderTokenResponse_oauthToken)**  
    The OAuth access token.
- **[provider](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Auth_AuthProviderTokenResponse.htm#apex_Auth_AuthProviderTokenResponse_provider)**  
    The authentication provider.
- **[state](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Auth_AuthProviderTokenResponse.htm#apex_Auth_AuthProviderTokenResponse_state)**  
    The state passed in to initiate the authentication request for the user.
- **[idToken](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Auth_AuthProviderTokenResponse.htm#apex_Auth_AuthProviderTokenResponse_idToken)**  
    The ID token from the third party in encoded JWT format.

### oauthSecretOrRefreshToken

The OAuth secret or refresh token for the currently logged-in user.

#### Signature

public String oauthSecretOrRefreshToken {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### oauthToken

The OAuth access token.

#### Signature

public String oauthToken {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### provider

The authentication provider.

#### Signature

public String provider {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### state

The state passed in to initiate the authentication request for the user.

#### Signature

public String state {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### idToken

The ID token from the third party in encoded JWT format.

#### Signature

public String idToken {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")