DEV Community


Kotlin Firebase Authentication – Google Sign In | Android

Software Engineer - Founder at
・2 min read

Kotlin Firebase Authentication – Google Sign In | Android

In previous post, we had built a simple register/login Android App using Firebase Email & Password authentication. Now we can let users authenticate with Firebase using Google Accounts by integrating Google Sign In into Kotin Android App.

Related articles:

I. Way to do

1. Add Firebase to Android App

  • Read Kotlin Firebase Authentication – How to Sign Up, Sign In, Sign Out, Verify Email | Android and follow steps to enable and implement Firebase Auth in your Android App.

  • Add dependency: build.gradle (App-level):

    dependencies {
    // ...
    implementation ''

    2. Enable Firebase Auth for Google Account

    Go to Your Firebase Project Console -> Authentication -> SIGN-IN METHOD -> Enable Google:

    3. Steps to authenticate with Firebase

    3.1 Integrate Google Sign In into App

    1- Add the Google Sign-In button:


    2- Configure Google Sign In object to request the user data:
    When you configure the GoogleSignInOptions object, call requestIdToken:

    override fun onCreate(savedInstanceState: Bundle?) {
    // ...
    val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)

    With WEB_CLIENT_ID from Credentials page in the API Console -> OAuth 2.0 client IDs (Type Web Application).

3- Configure GoogleApiClient object with access to the Google Sign In API and the options above:

More at:

Kotlin Firebase Authentication – Google Sign In | Android

Discussion (0)