Exported app now i getting FirebaseError Permission denied
Set Firebase rules to test mode.
i.e.
{
“rules”: {
“.read”: true,
“.write”: true
}
}
in test mode it store value but i only want Authorized User to read-writhe data
Any Solution? I’m running into the same issue. My users authenticate just fine, but I get a permission denied error if I’m not in test mode. Even “auth != null” doesn’t work.
+1
My app works pretty fine when I compile the apk, install and run on my device but as soon as I publish it to PlayStore it runs into FireBase Login failure. I’m using the Google Sign In option for Login! Please respond if someone can help. TIA!
Try the solution in this thread
As I said earlier
But,
I mean to say when I download my app from Playstore and after Google SignIn my app runs into Login_Failed() everytime!
I tried flushing my entire database to null but there isn’t any difference.
I am attaching my blocks below:
One thing I’m seeing that seems to be missing is setting the Firebase Token. Not setting the token after login will get you a login error. I got them constantly without setting read/write to true until I learned that. Give it a shot. Check out the topic I linked and it should all be explained there.
I’ve set the Firebase Token in the Designer part itself and also my Firebase Rules are in Test Mode i.e., both read/write are set to true. Is there any way to retrieve the login error message as we can get that in SignUp_Failed()??
Firebase Token is usually different in every session. Setting it in the designer is not the best practice.
Correct me if I’m wrong. But we need to set this Web API Key as Firebase Token for all the Firebase instances right? So why would it change in every session? Also if that be the issue then the app won’t have worked when compiled. The app is going under Login Failed only when published to the play store.
The firebase token should match the ID token from the authenticator. The ID token changes when you use the authenticator to log in. The ID token resets hourly (I believe), so you have to pull the ID token on firebase error with the authenticator and update the firebase token with it to keep from getting those errors. Once I took these steps I never saw that error again and could update my firebase rules instead of leaving read/write permissions to true.
I updated my blocks as per the guide you mentioned above and it is working fine as per now. I’ve applied for an update on the PlayStore and will let you know if everything goes good. Thanks
@GaryH It is still causing the same error. It is running into Login_Failed() When I’m installing from Playstore. My blocks are given above… Any help would be appreciated
Have you added the SHA-1 certificate to the firebase?
- Go to your Google Play console > App Signing certificate > copy it
- Go to your firebase account > project settings > (Here you should already add your app and upload google-services.joson to Kodular) > project info and add fingerprint > paste the signing certificate from google play console.
Besides, I noticed that you didn’t set up the clock component the right way.
The porose for the clock here is when you have private rules, the clock waits 1 second after the token gets set. Then, you set the project bucket.
I would suggest to add this block and leave empty to ignore the error on start (permission denied).
I can see an MD5, SHA1 and SHA-256 certificate under app signing certificate.
- Do I need to add only the SHA-1 certificate to firebase or do I need to add SHA-256 certificate also?
- Also I want to mention that, previously I’ve already added the SHA-1 certificate from Kodular Settings to the Firebase. Do I need to do anything with that?
- After adding the SHA-1 certificate of PlayStore to Firebase do I need to regenerate the google-services.json file and update in Kodular or the one I’m already having their would work fine?
- After all the above tasks is it necessary to recompile an APK and publish to Playstore or only adding the fingerprint to Firebase would directly work? (The lamest question among all)
Thanks @Hassan for providing the details and it would be great if you can answer my above queries too
In your case, you would need only SHA-1
SHA-1 : Used to create OAuth 2 client and API key for your app
SHA-256 : Used for configuring Firebase Dynamic links
As far as I know, you may add both, the one from Kodular and Firebase.
I would prefer to regenerate the file and upload the new apk because the google-services.json file may get updated.
I added the SHA-256 too before you replied
Did so and published on PlayStore waiting for a successful rollout. I’ll let you know if this works!
SOLUTION! I can’t mark solution since I didn’t started this feed. LOL
Thank you so much @Hassan
You are very welcome