Class JWTAccess (7.6.2)

Package

google-auth-library!

Constructors

(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.

Parameters
NameDescription
email 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;
Property Value
TypeDescription
number

email

email?: string | null;
Property Value
TypeDescription
string | null

key

key?: string | null;
Property Value
TypeDescription
string | null

keyId

keyId?: string | null;
Property Value
TypeDescription
string | null

projectId

projectId?: string;
Property Value
TypeDescription
string

Methods

fromJSON(json)

fromJSON(json: JWTInput): void;

Create a JWTAccess credentials instance using the given input options.

Parameter
NameDescription
json JWTInput

The input object.

Returns
TypeDescription
void

fromStream(inputStream)

fromStream(inputStream: stream.Readable): Promise<void>;

Create a JWTAccess credentials instance using the given input stream.

Parameter
NameDescription
inputStream stream.Readable

The input stream.

Returns
TypeDescription
Promise<void>

fromStream(inputStream, callback)

fromStream(inputStream: stream.Readable, callback: (err?: Error) => void): void;
Parameters
NameDescription
inputStream stream.Readable
callback (err?: Error) => void
Returns
TypeDescription
void

getRequestHeaders(url, additionalClaims)

getRequestHeaders(url: string, additionalClaims?: Claims): Headers;

Get a non-expired access token, after refreshing if necessary.

Parameters
NameDescription
url string

The URI being authorized.

additionalClaims Claims

An object with a set of additional claims to include in the payload.

Returns
TypeDescription
Headers

An object that includes the authorization header.