UNPKG

896 BTypeScriptView Raw
1import { OAuth2Client, RequestMetadataResponse } from './oauth2client';
2export interface IdTokenOptions {
3 /**
4 * The client to make the request to fetch an ID token.
5 */
6 idTokenProvider: IdTokenProvider;
7 /**
8 * The audience to use when requesting an ID token.
9 */
10 targetAudience: string;
11}
12export interface IdTokenProvider {
13 fetchIdToken: (targetAudience: string) => Promise<string>;
14}
15export declare class IdTokenClient extends OAuth2Client {
16 targetAudience: string;
17 idTokenProvider: IdTokenProvider;
18 /**
19 * Google ID Token client
20 *
21 * Retrieve access token from the metadata server.
22 * See: https://developers.google.com/compute/docs/authentication
23 */
24 constructor(options: IdTokenOptions);
25 protected getRequestMetadataAsync(url?: string | null): Promise<RequestMetadataResponse>;
26 private getIdTokenExpiryDate;
27}