new JWT(options)
JWT service account credentials.
Retrieve access token using gtoken.
Parameters:
Name | Type | Description |
---|---|---|
options |
the |
Methods
createGToken()
Create a gToken if it doesn't already exist.
createScoped(scopes)
Creates a copy of the credential with the specified scopes.
Parameters:
Name | Type | Description |
---|---|---|
scopes |
List of requested scopes or a single scope. |
Returns:
Type | Description |
---|---|
The cloned instance. |
(async) fetchIdToken(targetAudience)
Fetches an ID token.
Parameters:
Name | Type | Description |
---|---|---|
targetAudience |
the audience for the fetched ID token. |
fromAPIKey(apiKey)
Creates a JWT credentials instance using an API Key for authentication.
Parameters:
Name | Type | Description |
---|---|---|
apiKey |
The API Key in string form. |
fromJSON(json)
Create a JWT credentials instance using the given input options.
Parameters:
Name | Type | Description |
---|---|---|
json |
The input object. |
(async) getCredentials()
Using the key or keyFile on the JWT client, obtain an object that contains the key and the client email.
(async) getRequestMetadataAsync(url)
Obtains the metadata to be sent with the request.
Parameters:
Name | Type | Description |
---|---|---|
url |
the URI being authorized. |
hasAnyScopes()
Are there any default or user scopes defined.
hasUserScopes()
Determine if there are currently scopes available.