# Google Auth Library Client - Class FetchAuthTokenInterface (1.50.1)

1.50.1 (latest) 1.50.0 1.49.0 1.48.1 1.47.1 1.46.0 1.45.2 Reference documentation and code samples for the Google Auth Library Client class FetchAuthTokenInterface.

An interface implemented by objects that can fetch auth tokens.

Classes which implement this interface in this package:

- [CredentialsLoader](https://docs.cloud.google.com/php/docs/reference/auth/latest/CredentialsLoader)
- [Credentials\\ExternalAccountCredentials](https://docs.cloud.google.com/php/docs/reference/auth/latest/Credentials.ExternalAccountCredentials)
- [Credentials\\GCECredentials](https://docs.cloud.google.com/php/docs/reference/auth/latest/Credentials.GCECredentials)
- [Credentials\\ImpersonatedServiceAccountCredentials](https://docs.cloud.google.com/php/docs/reference/auth/latest/Credentials.ImpersonatedServiceAccountCredentials)
- [Credentials\\InsecureCredentials](https://docs.cloud.google.com/php/docs/reference/auth/latest/Credentials.InsecureCredentials)
- [Credentials\\ServiceAccountCredentials](https://docs.cloud.google.com/php/docs/reference/auth/latest/Credentials.ServiceAccountCredentials)
- [Credentials\\ServiceAccountJwtAccessCredentials](https://docs.cloud.google.com/php/docs/reference/auth/latest/Credentials.ServiceAccountJwtAccessCredentials)
- [Credentials\\UserRefreshCredentials](https://docs.cloud.google.com/php/docs/reference/auth/latest/Credentials.UserRefreshCredentials)
- [FetchAuthTokenCache](https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenCache)
- [OAuth2](https://docs.cloud.google.com/php/docs/reference/auth/latest/OAuth2)

## Namespace

Google \\ Auth

## Methods

### fetchAuthToken

Fetches the auth tokens based on the current state.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `httpHandler` | `callable|null` callback which delivers psr7 request |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `array` | a hash of auth tokens |

### getCacheKey

Obtains a key that can used to cache the results of #fetchAuthToken.

If the value is empty, the auth token is not cached.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | a key that may be used to cache the auth token. |

### getLastReceivedToken

Returns an associative array with the token and
expiration time.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `null|array` | { The last received access token. @type string $access_token The access token string. @type int $expires_at The time the token expires as a UNIX timestamp. } |