# Google Auth Library Client - Class FileSource (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 FileSource.

Retrieve a token from a file.

## Namespace

Google \\ Auth \\ CredentialSource

## Methods

### __construct

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `file` | `string` The file to read the subject token from. |
| `format` | `string|null` The format of the token in the file. Can be null or "json". |
| `subjectTokenFieldName` | `string|null` The name of the field containing the token in the file. This is required when format is "json". |

### fetchSubjectToken

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `httpHandler` | `?callable` |

### getCacheKey

Gets the unique key for caching.

The format for the cache key one of the following:
Filename

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |