Android Firebase Authentication for Google Signin fails

后端 未结 4 1150
感动是毒
感动是毒 2021-01-14 15:16

I followed the firebase documentation from top to bottom and implemented a simple google Sign in option to my app. However, when I try to signin, the process halts after sel

相关标签:
4条回答
  • 2021-01-14 15:52

    check if "Identity Toolkit API" is enabled in google API console

    0 讨论(0)
  • 2021-01-14 16:03

    Make sure that you have entered the SHA1 of your signing keystore. Here's the guide https://developers.google.com/android/guides/client-auth

    You have to find two directories, 1. a directory where JDK have been installed 2. .android

    If you are using Windows, '.android' folder might be placed in 'C:\Users\username\', and JDK directory might be placed in like 'C:\Users\Program files\java\'.

    In my case, my OS is Windows, so first i was looking for my jdk folder.

    In 'jdk_folder\bin\' you would find 'keytool.exe' and I used this command

    '.\keytool -exportcert -list -v -alias androiddebugkey -keystore C:\Users\sgc109\ .android\debug.keystore'.

    Then, copy SHA1 key and paste to firebase console(setting - general - my app - SHA certificate finger print(?)' (I live in Korea, so names of menu could be different with me) and it works :)

    0 讨论(0)
  • 2021-01-14 16:08

    Go to the firebase console and enable the sign in provider first. https://console.firebase.google.com/u/2/project/ipay-71f01/authentication/providers

    I had the same issue but this was the solution for me. Thanks

    0 讨论(0)
  • 2021-01-14 16:12

    In my previous test app using Firebase FriendlyChat, I have encountered similar failure in Sign In, but I have solved it by going Google API console (https://console.developers.google.com/apis/credentials?project=) then download "client_secret.json" (in my case, I need to rename the downloaded filename "client_secret_xxxxx.json") for your Android client, put this file in your AndroidStudio project under "/src/main/resources" (create "resources" folder if not exist) then try to compile and run your Android app again.

    Summary: you need 2 json files : "google-services.json" from Firebase Console and "client_secret.json" from Google API Console.

    Hope this solve your problem.

    0 讨论(0)
提交回复
热议问题