GoogleAuthProvider

public classGoogleAuthProvider


Represents the Google Sign-In authentication provider. Use this class to obtain s.

Summary

Constants

static finalString
GOOGLE_SIGN_IN_METHOD = "google.com"

Unique string identifier for Google sign-in method.

static finalString
PROVIDER_ID = "google.com"

Unique string identifier for this provider type.

Public methods

static @NonNullAuthCredential
getCredential(@NullableString idToken, @NullableString accessToken)

Returns a new instance ofAuthCredential that wraps Google Sign-In ID or access tokens.

Constants

GOOGLE_SIGN_IN_METHOD

public static final String GOOGLE_SIGN_IN_METHOD = "google.com"

Unique string identifier for Google sign-in method.

PROVIDER_ID

public static final String PROVIDER_ID = "google.com"

Unique string identifier for this provider type.

Public methods

getCredential

public static @NonNullAuthCredential getCredential(@NullableString idToken, @NullableString accessToken)

Returns a new instance ofAuthCredential that wraps Google Sign-In ID or access tokens. Used when callingsignInWithCredential orlinkWithCredential.

Both parameters are optional but at least one must be present.

Parameters
@NullableString idToken

a valid Google Sign-In id token, obtained from the Google Sign-In SDK

@NullableString accessToken

a valid Google Sign-In access token, obtained from the Google Sign-In SDK

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-07-21 UTC.