Comments (4)
@mthnzbk please report the issue in firebase-rest-api repository.
from pyrebase4.
@mthnzbk in case you need those methods for a project, check firebase-rest-api where I've already implemented them.
from pyrebase4.
`Traceback (most recent call last):
File "C:\Users\venv\lib\site-packages\firebase_exception.py", line 13, in raise_detailed_error
request_object.raise_for_status()
File "C:\Users\venv\lib\site-packages\requests\models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://www.googleapis.com/identitytoolkit/v3/relyingparty/createAuthUri?key=AIzaSyDFP8PMnJzIl-4q8fsnkz1uvEPE3nHivcA
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\main.py", line 34, in
print(auth.authenticate_login_with_facebook())
File "C:\Users\venv\lib\site-packages\firebase\auth_init_.py", line 78, in authenticate_login_with_facebook
return self.create_authentication_uri('facebook.com')
File "C:\Users\venv\lib\site-packages\firebase\auth_init_.py", line 127, in create_authentication_uri
raise_detailed_error(request_object)
File "C:\User\venv\lib\site-packages\firebase_exception.py", line 17, in raise_detailed_error
raise HTTPError(e, request_object.text)
requests.exceptions.HTTPError: [Errno 400 Client Error: Bad Request for url: https://www.googleapis.com/identitytoolkit/v3/relyingparty/createAuthUri?key=AIzaSyDFP8PMnJzIl-4q8fsnkz1uvEPE3nHivcA] {
"error": {
"code": 400,
"message": "INVALID_CONTINUE_URI",
"errors": [
{
"message": "INVALID_CONTINUE_URI",
"domain": "global",
"reason": "invalid"
}
]
}
}`
I think I entered the information correctly. this is the error I get.
auth = firebase.auth(client_secret="client_secret.json") auth.authenticate_login_with_facebook()
client_secret.json:
{ "client_id": "1234", "client_secret": "1a2s", "redirect_uris": "https://xxx.firebaseapp.com/__/auth/handler" }
from pyrebase4.
I implemented the method sign_in_with_idp_token for the Auth class, which works nicely ; be good to see this added into the main branch.
def sign_in_with_idp_token(self, token, redirect_uri, provider):
request_ref = "https://identitytoolkit.googleapis.com/v1/accounts:signInWithIdp?key={0}".format(self.api_key)
headers = {"content-type": "application/json; charset=UTF-8"}
postbody = "id_token=" + token + "&providerId=" + provider
data = json.dumps({"postBody":postbody,"requestUri":redirect_uri,"returnIdpCredential":True,"returnSecureToken":True})
request_object = requests.post(request_ref, headers=headers, data=data)
raise_detailed_error(request_object)
return request_object.json()
Params ( token = id_token (oauth token given back from the provider), redirect_uri e.g. "https://localhost", and provider is the identify platform provider e.g. "google.com" for google signin. Tested for Google, but should work with other providers ok.
from pyrebase4.
Related Issues (20)
- Pyrebase4 and Security Rules HOT 1
- Firestore Database HOT 1
- Firebase Storage - Download Path HOT 2
- Creating custom token fails HOT 1
- Firebase.init() throws error when JSON config has no `databaseURL` key HOT 2
- put method for storage throws error after authenticating server as service account
- AttributeError: module 'collections' has no attribute 'MutableMapping'
- Unable to dynamically assign db collections path
- Library needs to be updated. Requests- Toolsbelt was updated today and Pyrebase4 now throws import error HOT 22
- import error
- FileNotFoundError: [Errno 2] No such file or directory: 'None'
- I could compile my app, now I can not HOT 4
- Auth methods other than email/password
- WARNING: Using the Firebase Admin SDK instead of this will save you time.
- KeyError: 'apiKey'` HOT 2
- Pyrebase4 isnt running well with requests, error occurs that says ModuleNotFoundError: No module named 'requests.packages.urllib3.contrib.appengine HOT 1
- python-jwt is deprecated
- requests 2.31.0 suppport. Is this repo still being maintained? HOT 2
- Release to conda-forge HOT 3
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 pyrebase4.