Firebase Phone Auth SHA-1 fingerprint Issue

643
  • if are using emulator then safety net fails make sure you using a legitimate with Android Device
  • it is possible that u using wrong keystore. best method for fnding debug SHA key is Gradle >> signinreport>>rightclick>>run

enter image description here

Share:
643
M J
Author by

M J

Updated on December 28, 2022

Comments

  • M J
    M J over 1 year

    I had created a sign in page in flutter using phone Authentication. In which i am getting the error:

    E/FirebaseAuth(21546): [SmsRetrieverHelper] SMS verification code request failed: unknown status code: 17028 A safety_net_token was passed, but no matching SHA-256 was registered in the Firebase console. Please make sure that this application’s packageName/SHA256 pair is registered in the Firebase Console. I/flutter (21546): This app is not authorized to use Firebase Authentication. Please verify that the correct package name and SHA-1 are configured in the Firebase Console. [ A safety_net_token was passed, but no matching SHA-256 was registered in the Firebase console. Please make sure that this application’s packageName/SHA256 pair is registered in the Firebase Console. ]

    I had already get the SHA1 and SHA256 key from the cmd by using the following steps:

    1. In cmd, visited the path where java jdk is installed(in my case:C:\Program Files\Java\jdk1.8.0_212)
    2. Then pasted the following command and hit enter keytool -list -v -keystore "C:\Users\Mehul Jain.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

    After that i got the key as shown in Screenshot.

    SHA1 Key

    copied both the keys and pasted in the firebase Console (as shown in Screenshot below) firebase console

    App is working correctly. And when I tried signing through test mode (i.e. entering the mobile no. and otp) and run the app with the test mode details, the app was working 100%. But if I want to add the mobile number from the app and try to get SMS the error comes on the screen. I had tried various other mobile number but still not worked(mobile number are not entered in test mode).

  • M J
    M J about 3 years
    Yes, from gradile SigningReport different SHA1 key is genrated. But then in CMD why does it shows another key?