# Interface ProgrammaticExternalAccountCredential.ISubjectTokenProvider (1.73.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [1.73.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2.ProgrammaticExternalAccountCredential.ISubjectTokenProvider)
- [1.69.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.69.0/Google.Apis.Auth.OAuth2.ProgrammaticExternalAccountCredential.ISubjectTokenProvider)
- [1.68.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.68.0/Google.Apis.Auth.OAuth2.ProgrammaticExternalAccountCredential.ISubjectTokenProvider)
- [1.60.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.60.0/Google.Apis.Auth.OAuth2.ProgrammaticExternalAccountCredential.ISubjectTokenProvider)
- [1.59.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.59.0/Google.Apis.Auth.OAuth2.ProgrammaticExternalAccountCredential.ISubjectTokenProvider)
- [1.55.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.55.0/Google.Apis.Auth.OAuth2.ProgrammaticExternalAccountCredential.ISubjectTokenProvider)
- [1.50.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.50.0/Google.Apis.Auth.OAuth2.ProgrammaticExternalAccountCredential.ISubjectTokenProvider)

    public interface ProgrammaticExternalAccountCredential.ISubjectTokenProvider

Subject token provider which is passed to a [ProgrammaticExternalAccountCredential](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2.ProgrammaticExternalAccountCredential) as the means
to obtain the third-party or external credentials token to include on the STS token exchange request.

## Namespace

[Google.Apis.Auth.OAuth2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2)

## Assembly

Google.Apis.Auth.dll

## Methods

### GetSubjectTokenAsync(ProgrammaticExternalAccountCredential, CancellationToken)

    Task<string> GetSubjectTokenAsync(ProgrammaticExternalAccountCredential caller, CancellationToken taskCancellationToken)

Obtains the subject token for the third-party credentials that will be inclded on the STS token exchange request.
The returned value will be included on the STS token exchange request as is.
This method will only be called when no Google access token has been obtained or it has (or is about to) expired,

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `caller` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2.ProgrammaticExternalAccountCredential` The credential calling this subject token provider. This may be useful to use state stored in the credential for obtaining the subject token, but should be ignored otherwise. Will not be null. |
| `taskCancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The cancellation token for the operation. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://learn.microsoft.com/dotnet/api/system.string` |   |

## Extension Method

[Utilities.ThrowIfNull\<T\>(T, string)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Util.Utilities#Google_Apis_Util_Utilities_ThrowIfNull__1___0_System_String_)