GoogleAuthProvider

classGoogleAuthProvider


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

Summary

Constants

constString!
GOOGLE_SIGN_IN_METHOD = "google.com"

Unique string identifier for Google sign-in method.

constString!
PROVIDER_ID = "google.com"

Unique string identifier for this provider type.

Public functions

java-staticAuthCredential
getCredential(idToken: String?, accessToken: String?)

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

Constants

GOOGLE_SIGN_IN_METHOD

const val GOOGLE_SIGN_IN_METHOD = "google.com": String!

Unique string identifier for Google sign-in method.

PROVIDER_ID

const val PROVIDER_ID = "google.com": String!

Unique string identifier for this provider type.

Public functions

getCredential

java-static fun getCredential(idToken: String?, accessToken: String?): AuthCredential

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
idToken: String?

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

accessToken: String?

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.