Giter Site home page Giter Site logo

Comments (5)

tommasodargenio avatar tommasodargenio commented on July 26, 2024 2

I followed the installation/activation instructions in the wiki to the letter. I've created a project in google console, and I've created an OAuth 2.0 credential using the desktop type, this has generated the web secret and the client ID. I've added this to the override.cfg as per instructions.

in Godot then I use the same code listed in the instructions:
Firebase.Auth.get_google_auth() to fire up the browser consent screen
and then Firebase.Auth.login_with_oauth(token.text) passing the token that I've got from the consent screen.

Since my Firebase account doesn't know anything about the google client ID I've created earlier, gives that IDP error.

Once I've added the google client ID in the Firebase whitelist, within the Google Sign-in settings it all worked fine.

I've also found that I needed to connect my script to the token_exchanged signal so that I can capture the access and refresh token otherwise these get overwritten in the second phase of the authentication workflow. Having this tokens is very important as after logging in, I would need to use some other Google APIs calls and I wouldn't be able to do that without the access token.

from godotfirebase.

fenix-hub avatar fenix-hub commented on July 26, 2024

Maybe I need some more info about this.

Did you enable Google sign-method?
What code did you use so I could replicate the same thing in a new project?
I'm asking because without precise context, I had no problem using the methods I implemented.
If I missed something or I was biased by my settings I should test it in a new project.

Thank you.

from godotfirebase.

fenix-hub avatar fenix-hub commented on July 26, 2024

Hi @tommasodargenio ,

Looks like the IDP error happens if you create credentials for a project different from the one you are using.
I've got two Firebase projects:

  • RistoranteDigitaleTest
  • My First Project

I setup my Godot project using RistoranteDigitaleTest's keys from Firebase.
I create OAuth keys using My First Project from Google Cloud Platform, and set clientId and clientSecret for the same Godot project.

Requesting OAuth authentication from my project, a google user will be authenticated using the My First Project oauth credentials on RistoranteDigitaleTest, which are keys still recognized as OAuth 2.0 but are not accepted for RistoranteDigitaleTest (since they were created for My First Project).

Now, I don't know what are your specific needings, but if you have more than one Firebase project always make sure to create your credentials for the same project you are using on Firebase.
coD0rnG2hN
G8yf6kKz6O
ed53Wd8rNS

Regarding tokens, here's a screen of the token request's response body
tQpQK0pB6c
All tokens are correctly returned, even after the first token_exchanged signal.
This is the message returned both after a first authorization, and when the user is already authorized and stored in the Firebase project.
This body is returned by the login_succeeded signal as a Dictionary, but you can always get it in the end of the process with Firebase.Auth.auth.

Honestly I don't know why they disappear from the latest call. It could be linked to the error you are getting in the first place, which should be fixed with the first answer I gave you.
Both a print of Firebase.Auth.auth after the token_exchanged and login_succeeded signal (with all fields censored) would be very useful, but I think that resolving the first problem should also resolve this.

I'll leave this issue opened so we can discuss further about this. Let me know what you can get and I'll help you the best I can.

from godotfirebase.

BearDooks avatar BearDooks commented on July 26, 2024

@tommasodargenio

Just checking in to see if you got this working or if you need more help.

Thanks

from godotfirebase.

tommasodargenio avatar tommasodargenio commented on July 26, 2024

Thanks for the extensive explanation. I had it working by the way I've explained. I guess when you saying that the OAuth credentials in GCP must be for the same project, you mean the project in GCP must have the same name as the one in Firebase as otherwise, I can't see a connection between the two platforms (i.e. I can't see my Firebase project in the GCP developer console).

either way, it works so I'm happy to close this now.

from godotfirebase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.