Provides cached, renewable credentials for an interactive federation account.
On the first login, the bearer opens a browser unless noBrowserOpen is
true. It writes the authorization URL with writer, waits for the local
callback, and stores the access token in the shared credentials file.
Later processes can reuse the cached token for the same profile.
This flow is intended for people at a workstation. Use a service account or workload federation for unattended applications.
Returns a JSON-safe value for logs.
Creates an interactive federation flow for profileName.
timeoutMs limits the wait for the browser callback. It does not limit the
following token HTTP request. cacheFilePath selects the shared token
cache. Close the SDK to stop renewal timers.
Optionalopts: {Optionalca?: string | string[] | Buffer<ArrayBufferLike>Extra trusted CA certificates. This bearer currently forwards only a Buffer value.
OptionalcacheFilePath?: stringCustom shared credentials-file path.
OptionalfileCacheThrottleMs?: numberMinimum interval between cache-file reads. Defaults to five minutes.
OptionalinitialRetryTimeoutMs?: numberInitial renewal backoff. Defaults to one second.
OptionalinitialSafetyMarginMs?: number | nullExtra lifetime required for the first cached token.
Defaults to two hours. null also selects this default. Valid cache
hits keep the margin for later fetches. A fetch clears it only after it
proceeds into the renewal path.
OptionallifetimeSafeFraction?: numberFraction of remaining lifetime to wait before renewal.
The default 0.9 renews with about 10% of the lifetime left.
Optionallogger?: LoggerOptional destination for diagnostic events.
OptionalmaxRetries?: numberMaximum total authentication attempts for one receiver. Defaults to 2.
OptionalmaxRetryTimeoutMs?: numberMaximum renewal backoff. Defaults to 60 seconds.
Optionalmetrics?: AuthMetricsInputOptional authentication metrics destination.
OptionalnoBrowserOpen?: booleanPrevents automatic browser launch when true.
OptionalretrySafetyMarginMs?: numberReserved for compatibility. The JavaScript implementation does not use this value.
OptionalretryTimeoutExponent?: numberMultiplier for exponential renewal backoff. Defaults to 1.5.
OptionaltimeoutMs?: numberTimeout for the browser callback, in milliseconds.
This value does not limit the following token HTTP request.
Optionalwriter?: (s: string) => voidReceives the authorization URL. The default writer uses console.log.
Readonly$typeContains the fully qualified runtime type name.
Returns the provider name for authorization metrics.
Returns the stable credential name used by file-backed token caches.
Most bearers do not have a name. Wrappers can add one with NamedBearer.
Returns the wrapped bearer.
Returns a JSON-safe value for logs.
Stops owned background work and closes the wrapped bearer.
OptionalgraceMs: numberCreates a token receiver.
Provides cached, renewable credentials for an interactive federation account.
On the first login, the bearer opens a browser unless
noBrowserOpenis true. It writes the authorization URL withwriter, waits for the local callback, and stores the access token in the shared credentials file. Later processes can reuse the cached token for the same profile.This flow is intended for people at a workstation. Use a service account or workload federation for unattended applications.
Example