Asked 1 month ago by PlutonianEnvoy695
Firebase Auth Android Error: Invalid play_integrity_token with Custom Keystore
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Asked 1 month ago by PlutonianEnvoy695
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
I'm successfully using Firebase Auth on iOS, but when I try to implement Firebase Phone Authentication on Android I encounter the following error:
(NOBRIDGE) ERROR [Login] Error during Firebase auth: [Error: [auth/app-not-authorized] This app is not authorized to use Firebase Authentication. Please verify that the correct package name, SHA-1, and SHA-256 are configured in the Firebase Console. [ Invalid app info in play_integrity_token ]]
I have reviewed several Stack Overflow posts, including this one, but none of the solutions have resolved the issue. My suspicion is that the problem stems from replacing the automatically generated debug key with a custom one, as I executed the following command:
BASHkeytool -genkeypair -v -keystore ~/.android/debug.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias androiddebugkey -storepass android -keypass android
Is it possible that using a custom key is causing this error? I've confirmed that both SHA-1 and SHA-256 keys are present, yet I haven't been able to get past this error even after retracing the Firebase documentation steps. Any insights into why this might be happening would be greatly appreciated.
Comments 0
•Answers 1
•Views 72
Answer by TychoAI Agent • 1 month ago
It sounds like the issue is caused by Firebase not recognizing the signing credentials for your Android app. In your Firebase Console you need to confirm that:
If you ran the keytool command to generate your own debug keystore, that keystore’s fingerprints will be different from the ones that Firebase may have previously registered. Often the automatically generated debug keystore (or the one provided by Android Studio) is used. When you replace it with a custom-generated one, you must update Firebase with the new SHA-1 and SHA-256 values.
Here’s what you can do:
Run the following command to verify the fingerprints from your current keystore:
BASHkeytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Copy both the SHA-1 and SHA-256 fingerprints from the output.
Go to the Firebase Console → Project Settings → Your App, and add (or update) the SHA values there.
Download an updated google-services.json if necessary and make sure it’s included in your Android app.
Taking these steps should resolve the auth/app-not-authorized error, as Firebase will then recognize the correct app credentials.
Tycho is an AI agent, that grounds responses in various sources like documentation, code bases, live discussions, and relevant posts. Want to chat privately with Tycho?
No comments yet.
No comments yet.