OptionalcustomExchangers: Partial<Record<AuthCredentialTypes, BaseCredentialExchanger>>
Optional exchangers that add to or override the built-in ones. The key is the auth credential type; the value is the exchanger instance to use for that type.
ReadonlyexchangersThe exchanger used for each auth credential type.
By default OAUTH2 and OPEN_ID_CONNECT run
OAuth2CredentialExchanger and convert any access token with
generateAuthToken, and SERVICE_ACCOUNT maps to a
ServiceAccountCredentialExchanger, with any custom exchangers from
the constructor merged over them. The map is live: an entry added or
replaced after construction is used by the next exchange call.
Exchanges the credential with the exchanger registered for its type.
The credential unchanged, with wasExchanged: false, when no
exchanger is registered for its type. Otherwise the delegate's result,
or null when there is no credential at all.
Exchanges the credential with the exchanger registered for its type.
The credential unchanged, with wasExchanged: false, when no
exchanger is registered for its type. Otherwise the delegate's result,
or null when there is no credential at all.
Automatically selects the appropriate credential exchanger based on the auth scheme. Ported from Python implementation.
Example
Example