Package
google-auth-libraryConstructors
(constructor)(email, key, keyId, eagerRefreshThresholdMillis)
constructor(email?: string | null, key?: string | null, keyId?: string | null, eagerRefreshThresholdMillis?: number);
JWTAccess service account credentials.
Create a new access token by using the credential to create a new JWT token that's recognized as the access token.
Name | Description |
string | null
the service account email address. | |
key |
string | null
the private key that will be used to sign the token. |
keyId |
string | null
the ID of the private key used to sign the token. |
eagerRefreshThresholdMillis |
number
|
Properties
eagerRefreshThresholdMillis
eagerRefreshThresholdMillis: number;
email?: string | null;
key
key?: string | null;
keyId
keyId?: string | null;
projectId
projectId?: string;
Methods
fromJSON(json)
fromJSON(json: JWTInput): void;
Create a JWTAccess credentials instance using the given input options.
Name | Description |
json |
JWTInput
The input object. |
Type | Description |
void |
fromStream(inputStream)
fromStream(inputStream: stream.Readable): Promise<void>;
Create a JWTAccess credentials instance using the given input stream.
Name | Description |
inputStream |
stream.Readable
The input stream. |
Type | Description |
Promise<void> |
fromStream(inputStream, callback)
fromStream(inputStream: stream.Readable, callback: (err?: Error) => void): void;
Name | Description |
inputStream |
stream.Readable
|
callback |
(err?: Error) => void
|
Type | Description |
void |
getCachedKey(url, scopes)
getCachedKey(url?: string, scopes?: string | string[]): string;
Ensures that we're caching a key appropriately, giving precedence to scopes vs. url
Name | Description |
url |
string
The URI being authorized. |
scopes |
string | string[]
The scope or scopes being authorized |
Type | Description |
string | A string that returns the cached key. |
getRequestHeaders(url, additionalClaims, scopes)
getRequestHeaders(url?: string, additionalClaims?: Claims, scopes?: string | string[]): Headers;
Get a non-expired access token, after refreshing if necessary.
Name | Description |
url |
string
The URI being authorized. |
additionalClaims |
Claims
An object with a set of additional claims to include in the payload. |
scopes |
string | string[]
|
Type | Description |
Headers | An object that includes the authorization header. |