Package cloud.google.com/go/auth/oauth2adapt (v0.2.8) Stay organized with collections Save and categorize content based on your preferences.
Package oauth2adapt helps converts types used incloud.google.com/go/authandgolang.org/x/oauth2.
Functions
func AddRetrieveErrorToAuthError
AddRetrieveErrorToAuthError returns the same error provided and adds a[golang.org/x/oauth2.RetrieveError] to the error chain by setting theErr field on the[cloud.google.com/go/auth.Error].
func AuthCredentialsFromOauth2Credentials
funcAuthCredentialsFromOauth2Credentials(creds*google.Credentials)*auth.CredentialsAuthCredentialsFromOauth2Credentials converts a [golang.org/x/oauth2/google.Credentials]to a [cloud.google.com/go/auth.Credentials].
func AuthErrorFromRetrieveError
funcAuthErrorFromRetrieveError(err*oauth2.RetrieveError)*auth.ErrorAuthErrorFromRetrieveError returns an [cloud.google.com/go/auth.Error] thatwraps the provided [golang.org/x/oauth2.RetrieveError].
func Oauth2CredentialsFromAuthCredentials
funcOauth2CredentialsFromAuthCredentials(creds*auth.Credentials)*google.CredentialsOauth2CredentialsFromAuthCredentials converts a [cloud.google.com/go/auth.Credentials]to a [golang.org/x/oauth2/google.Credentials].
func TokenProviderFromTokenSource
funcTokenProviderFromTokenSource(tsoauth2.TokenSource)auth.TokenProviderTokenProviderFromTokenSource converts any [golang.org/x/oauth2.TokenSource]into a [cloud.google.com/go/auth.TokenProvider].
func TokenSourceFromTokenProvider
funcTokenSourceFromTokenProvider(tpauth.TokenProvider)oauth2.TokenSourceTokenSourceFromTokenProvider converts any[cloud.google.com/go/auth.TokenProvider] into a[golang.org/x/oauth2.TokenSource].
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.