Comments (5)
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.
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.
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.
Regarding tokens, here's a screen of the token request's response body
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.
Just checking in to see if you got this working or if you need more help.
Thanks
from godotfirebase.
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)
- The plugin dosn't want to work in Godot v4.2.1 ?? HOT 5
- [BUG] It wont work on Godot 4.2 Stable HOT 10
- [BUG] after authentication Firestore still return 403 on get_doc() (4.x) HOT 6
- Error in the function get_doc in Godot 4.0.3 HOT 2
- [ISSUE] Send an error to console when there is no response (HTML5) HOT 8
- [BUG] Godot 4 doesn't have "JavaScript" feature tag anymore. HOT 4
- How to get data from realtime database HOT 1
- [FEATURE REQUEST] Firebase Auth - Convert an anonymous account to a permanent account HOT 1
- parse: Error parsing JSON at line 2: Expected 'EOF' HOT 2
- [FEATURE REQUEST] Oauth PKCE support (Oauth client_secret should be optional) HOT 5
- [FEATURE REQUEST] read only when something changed HOT 1
- [BUG] HOT 2
- Godot 4.x "Get a Document" example is broken and fails. HOT 1
- Firebase Index[BUG]
- [BUG] Latest addon on 4.x branch doesn not work for Godot 4.2.2 HOT 2
- [BUG] Firebase Storage: A StorageRefrence is valid even though the file it refrences does not exist. HOT 7
- Not a bug. I need help understanding how to delete one object from Firestore in Firebase. HOT 5
- [BUG] Invalid get index 'fields' (on base: 'Dictionary'). HOT 1
- [BUG] Firebase Storage Invalid Index HOT 2
- [FEATURE REQUEST] How to push notification by FCM HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godotfirebase.