react-native-firebase/auth [auth/app-not-authorized] - firebase

While updating the version from 12.7.3 to 14 or above directly the OTP is not sent and gets the following error.
[auth/app-not-authorized]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.
Verified that package name and SHA-1 and SHA-256 are correct for both developing and production environments. Not sure what is missing.

Related

Configure phone auth for second firebase project in react native app

I'm struggling to configure two Firebase projects in one React Native app. I've successfully initialized the second app by following the instructions at Firebase Docs. But, when I use the secondary phone auth, it fails.
This is the error message on Android:
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. ]
And this is the error message on iOS:
[Error: [auth/invalid-app-credential] Invalid token.]
In the Firebase Console of the second app, I've set up all credentials to identify clients:
iOS: p8 file to the Cloud Messaging tab, add URL schemes, ...
Android: SHA-1, and SHA-256 fingerprints
Is this implementation possible? Am I missing any step?
P/s: I also have created a new discussion in the rnfirebase Github repository: Link

Firebase phone auth failing on app already in production with status code 17028

We are using firebase phone authentication to authenticate our users. We've been using it for over a year now.
Today at 13:00 GMT, new users are receiving 17028 An invalid safety_net_token was passed after entering their phone number.
I tried to verify each of the causes I found on the firebase docs:
Verifying the SHA1 and SHA256 on the firebase console (We use the fingerprints that are on the play store console)
Verifying the package name
The last app update was on October 1st and since then thousands of users created an account with Firebase Auth and there were no configuration changes on the firebase console.
Upon looking at other StackOverflow questions, the error we are getting is not the same as 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 Even though it is the same error code, in our case, it says an invalid token was passed.
We are using firebase with react-native-firebase module.
EDIT: After disabling Android device verification API from Google Cloud Console the verification is now working but with no device verification. (Users have to verify they're not robots with a CAPTCHA).
Update: It is working fine now, and the outage has been fixed.
It looks to be a firebase internal issue, and the only solution now is to disable "Android Device Verification" and all your users will see the Recaptcha page.
check
https://status.firebase.google.com/
https://status.firebase.google.com/incidents/TYeQBVB4kkzyk2kE8vbP

Huawei Map Kit - Certificates

Summary of our problem:
We released last week our app bundle in the Huawei AppGallery.
We used the Huawei Map Kit in order to integrate Maps. However, there seems to be a problem with map kit.
We receive the error messages:
V/HmsMapKit_MapDataVersionClient_15: build request with apiKey
D/HmsMapKit_AuthenticateClient_86: response code : 401
E/HmsMapKit_TileCache_38: startUrlRequest Identity fail, do not has permission get tile. authResult :010002
What we have done so far:
Enable mapkit in AppGallery connect
Add sha256 fingerprints of the signed bundle to the app in AppGallery conncet
Build the app with agconnect-services.json
Initializing mapkit with the api key setup on the huawei developer page
Encode the API key as below: URLEncoder.encode("", "utf-8")
Tested the rc before uploading where it worked perfectly fine
As we are having troubles in identifying the cause for our problem, it would be very helpful to get further advice.
Thank you very much in advance.
Seems to be you are.using signing by AppGallery.
If so, you have to add one more SHA-256 to project settings, which you can get from application singing settings in console
According to this Docs,It's most likely caused by the following:
When localy building apk works but store submitted apk does not work, it is most likely the signing issue.
And for App bundle signing, there are 2 ways.
AppGallery Connect generates a new signature key for your new app
App Signing allows you to upload your own signature key
NOTE
Once a signature key is generated in AppGallery Connect or uploaded by you, it cannot be modified.
so depends on the approach, you might already have a signature key that is fixed already.
and it seems in this case you have your own signature key.
when we need to use upload key to sign apk before submit to AppGallery, do not use signature key to sign for upload apk, in this case, also upload key certificate and upload key to AppGallery.
need to make sure signature key certificate and upload key certificate are correct if used.

Firebase: Google api key restriction doesn't work

Firebase created for me an API key on Google API console. There I added a restriction to make it usable only by an Android app with a specific package name and fingerprint.
However I can still use the key with a different package name (I changed the application Id for Gradle). What could be wrong?
Firebase doesn't attempt to restrict usage of Realtime Database based on the host app's application ID or signing hash. When you create a new Android app in the console, you'll notice the following text under the text field for signing key:
Required for Dynamic Links, Invites, and Google Sign-In support in
Auth. Edit SHA-1s in Settings.
These are the only Firebase features that are affected by the application ID and signing hash. The reason an application ID is require is to help the Gradle plugin match a google-services.json file to the app it was built for. It's not a security measure.
If you change your application ID in build.gradle but don't create a new app and download a new google-services.json file, your build should fail with this message:
No matching client found for package name 'your.new.package.name'

Firebase CLI Authentication through token

I followed the steps described in the official GitHub tutorial for use the Firebase CLI (Command Line) with a CI system (simple OS without browser integrate). I use my PC to login in firebase and get the token (from the browser procedure). I copied the token on the other system and I passed the token in all command but it does not work. I get the message that I need to be authenticate for doing these operations:
firebase login
firebase prefs:token
copy and use the token in other system
firebase list --token sdfgfdsg......
What's the problem?
Using a machine with a browser and firebase tools installed, run firebase login:ci --no-localhost and paste the resulting key from the firebase CLI tool into an Environmental Variable and name it FIREBASE_TOKEN (not $FIREBASE_TOKEN).
In your deployment, say
npm install -g firebase-tools
firebase deploy
Make sure not to run firebase logout on your PC, as doing so will invalidate the token (we're working on making this clearer now, actually).
If not, make sure that you're quoting the token:
firebase list --token '-K.....|.....'
The characters included in the auth token may cause shell errors that prevent the command from completing properly if it's not quoted.
I was facing the same problem with Travis, and the problem was the encryption of the token used by travis, you have to ensure you have correctly escaped the pipe symbol inside the token.
in my case something like
travis encrypt 'FIREBASE_TOKEN=-jksdjksjksdj\|ksdkjsjk'
Hope this helps, because I can ensure you that if you do:
firebase deploy --token '-jksdjksjksdj|ksdkjsjk'
in Travis it just works.
firebase is not recognizing the token in your case for some reason, you need to find that reason
Check this out:
http://docs.travis-ci.com/user/encryption-keys/

Resources