Open mthnzbk opened 1 year ago
Hello @mthnzbk , thank you for submitting an issue! A project committer will shortly review the issue.
The key redirect_uris
in the client secret file is supposed be an array, not a string.
Please try reformatting it in the following example:
{
"client_id": "1234",
"client_secret": "1a2s",
"redirect_uris": ["https://xxx.firebaseapp.com/__/auth/handler"]
}
"Unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared." -> When I click on the link and authorize, the firebase link gives this output.
Would like your thoughts on including this in the auth docs as it can be a bit confusing when you realise client secret is both the object and within the object. I have remove references to config.py (ie BaseConfig.CLIENT_SECRET), if that is more general.
Client secret as a json file or dict must be passed when using SSO (just google) functions.
auth = app.auth(client_secret=CLIENT_SECRET)
CLIENT_SECRET = {"web": {
"client_id": environ.get("CLIENT_ID"),
"client_secret": environ.get("CLIENT_SECRET"),
"redirect_uris": [environ.get("REDIRECT_URI")]
}}
or
auth = firebase.auth(client_secret="client_secret.json")
client_secret.json format:
{
"client_id": "1234",
"client_secret": "1a2s",
"redirect_uris": ["https://xxx.firebaseapp.com/__/auth/handler"]
}
please where can i get this client_secret.json
@kengoon Create an API key
Where do you get the redirect_uris, I can see one in OAuth but doesn't work. Also my redirect_uris look like http://localhost not like the one you've mentioned. Can someone help me out?
Where do you get the redirect_uris, I can see one in OAuth but doesn't work. Also my redirect_uris look like http://localhost not like the one you've mentioned. Can someone help me out?
As soon as I post this I figured it out, sorry. You have to go to your authentication settings in firebase and click authorized domains, find the link which ends in .com and paste it: https://paste_here/__/auth/handler After this, I'm unsure how to get rid of as I added the redirect uri to the authorized apps in google cloud.
"Unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared. Some specific scenarios are - 1) Using IDP-Initiated SAML SSO. 2) Using signInWithRedirect in a storage-partitioned browser environment."
Is there an existing issue for this?
Environment
What happened?
`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\authinit.py", line 78, in authenticate_login_with_facebook return self.create_authentication_uri('facebook.com') File "C:\Users\venv\lib\site-packages\firebase\authinit.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" }
Code Snippet
Relevant log output
No response
Anything else?
No response