Setting up Firebase Phone Authentication, Google Sign-In, or Dynamic Links in Android apps often fails with errors like com.google.firebase.auth.FirebaseAuthException: This app is not authorized to use Firebase Authentication. This happens because Firebase requires your Android app’s SHA-1 and SHA-256 cryptographic certificate fingerprints registered in the Firebase Console to verify incoming OAuth requests.
Step 1: Extract SHA-1 & SHA-256 Using Gradle signingReport
The fastest way to generate SHA fingerprints for your debug keystore is running the Gradle signingReport task inside Android Studio or terminal:
# Run Gradle signingReport on Linux / macOS
./gradlew signingReport
# Run Gradle signingReport on Windows
gradlew.bat signingReportExpected Terminal Output:
Variant: debug
Config: debug
Store: /home/user/.android/debug.keystore
Alias: AndroidDebugKey
SHA1: 45:A1:8B:79:32:FF:11:00:88:AA:BB:CC:DD:EE:FF:12:34:56:78:90
SHA-256: 12:34:56:78:90:AB:CD:EF:11:22:33:44:55:66:77:88:99:00:AA:BB:CC:DD:EE:FF:00:11:22:33:44:55:66Step 2: Register Fingerprints in Firebase Console
Open the Firebase Console and select your project.
Click the Gear icon (Project Settings) in the left sidebar.
Scroll down to the Your apps section and select your Android app.
Click Add fingerprint and paste your copied SHA-1 string.
Click Add fingerprint again and paste your SHA-256 string.
Download the updated
google-services.jsonfile and replace it in your project’sapp/folder.
Comments and corrections