Enum IdTokenProvider.Option (1.58.0)

public enum IdTokenProvider.Option extends Enum<IdTokenProvider.Option>

Enum of various credential-specific options to apply to the token.

ComputeEngineCredentials

  • FORMAT_FULL
  • LICENSES_TRUE
  • DISABLE_BOUND_ID_TOKEN


ImpersonatedCredential

  • INCLUDE_EMAIL

Static Fields

Name Description
DISABLE_BOUND_ID_TOKEN

Requests an ID token that is not bound to the workload's agent identity certificate.

This option is only supported by ComputeEngineCredentials; other IdTokenProvider implementations do not request bound ID tokens and ignore this option.

When an agent identity certificate is available, ComputeEngineCredentials requests certificate-bound ID tokens by default. A bound ID token is only accepted by targets that authenticate the caller over mTLS with the same certificate. Pass this option for targets that are called over standard (non-mTLS) HTTPS, for example a Cloud Run service reached through its *.run.app URL or a custom domain.

Unlike the GOOGLE_API_ENABLE_RUNTIME_BOUND_TOKEN=false environment variable, which globally disables certificate-bound access tokens and ID tokens across the entire process, this option applies per call (or per IdTokenCredentials instance) and leaves access tokens and other ID token requests bound. If this option is not set, the library decides whether to bind the ID token. Currently, it is bound whenever an agent identity certificate is available and token binding is not globally disabled by GOOGLE_API_ENABLE_RUNTIME_BOUND_TOKEN=false.

FORMAT_FULL
INCLUDE_EMAIL
LICENSES_TRUE

Static Methods

Name Description
valueOf(String name)
values()

Methods

Name Description
getOption()