Skip to content

Auth not working in Unity editor #1048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GoShikhar opened this issue Jun 19, 2024 · 7 comments
Closed

Auth not working in Unity editor #1048

GoShikhar opened this issue Jun 19, 2024 · 7 comments
Labels
api: auth needs-attention Need Googler's attention

Comments

@GoShikhar
Copy link

GoShikhar commented Jun 19, 2024

Facing a weird auth issue in Unity editor whereby auth isn't working all of a sudden.
The sign-in and token refresh was working in this project but out of nowhere it isn't anymore in Unity editor. We haven't updated Unity editor, we have updated to the latest firebase sdk now, still no luck.
Although, it's working as expected in the built android apk.

Unity editor: 2023.2.18f1
Firebase Sdk: 12

These methods give errors which aren't much detailed.
SignInWithEmailAndPasswordAsync, user.TokenAsync()

Exception: An internal error has occurred.
StackTrace:   at Firebase.Auth.FirebaseAuth.SignInWithEmailAndPasswordAsync (System.String email, System.String password) [0x00038] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/linux_unity/auth/swig/Firebase.Auth_fixed.cs:3555 
UnityEngine.Debug:LogError (object)
FirebaseManager:<SignInEmail>b__97_0 (System.Threading.Tasks.Task`1<Firebase.Auth.AuthResult>) 

Can anyone please help here?

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@argzdev
Copy link

argzdev commented Jun 19, 2024

Thanks for reaching out, @GoShikhar. I'm wondering if there's an issue with our Firebase Auth version 12.0.0. Could you try and use version 11.9.0 as a mitigation? At the same time, any chance you could provide a minimal reproducible example of this issue? I'm currently trying to test this with our Unity Quickstart for Auth, however it doesn't seem like there's an issue with the email/password login.

@argzdev argzdev added the needs-info Need information for the developer label Jun 19, 2024
@GoShikhar
Copy link
Author

GoShikhar commented Jun 19, 2024

@argzdev Our project was on 11.8.1 and auth was working perfectly for a few months, and yesterday out of the blue, auth stopped working in the editor.
We double checked a lot of things and then finally we decided to upgrade the Firebase SDK itself to 12.0.
So, it stopped working on 11.8.1. Then we upgraded the sdk to 12.0 and it still isn't working in editor.
When we build the apk for android, auth is working perfectly fine.

This is a prod project and we have been using firebase auth since 2021 in this project. Never had this weird issue of auth not working in editor.

@argzdev given the above info, would you still want us to switch to 11.9.0 and test it out? Let me know.

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Jun 19, 2024
@GoShikhar
Copy link
Author

@argzdev I used
Firebase.FirebaseApp.LogLevel = Firebase.LogLevel.Debug;

and I'm getting this in logs:

Failed to read user data for app (__FIRAPP_DEFAULT). This could happen if the current user doesn't have access to the keystore, the keystore has been corrupted or the app intentionally deleted the stored data.

@GoShikhar
Copy link
Author

GoShikhar commented Jun 20, 2024

@argzdev This seems to be similar to firebase/firebase-cpp-sdk#10 issue. Any help here?

@GoShikhar
Copy link
Author

Found the issue.
2 days ago, we enabled Google Maps Api platform for our project on GCP.
While doing so it asked us to protect the api access by setting the apk bundle name and sha-1.
We entered the details and what it did was that it restricted access to the apis only to the built android app and did not allow editor.

Screenshot 2024-06-20 142729

@argzdev
Copy link

argzdev commented Jun 20, 2024

Sorry for the delayed response, @GoShikhar. I'm glad you were able to resolve your issue, thank you for sharing the solution of your problem. I'm sure it'll help other folks who encounter the same issue.

@firebase firebase locked and limited conversation to collaborators Jul 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: auth needs-attention Need Googler's attention
Projects
None yet
Development

No branches or pull requests

3 participants