You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working on a small project that uses Google OAuth, and it worked perfectly until i had to put it on production. The errors only happen in production and doesnt seem to be related with incorrect URIs because i double checked all of them but i might be wrong
I'm hosting the front-end of my project on GitHub Pages, and the back-end (this Django API) on Heroku. When hosting both on localhost i can log-in normally, but when trying to do it on production, i get the following error:
{non_field_errors: ["Session value state missing."]}
For the looks of it, maybe i was not properly sending the state, but i was, both state and code were being sent correctly
The big difference I noticed between the local payload and the production one are some headers, main difference was the Cookies header missing on the production one, and they had a sessionid and a csrftoken on it, but i could not find any way to send those Cookies on the header, neither the reason of why they aren't being sent to the production API, only the local one
After not having any sucess, i tried the desperate measure of overriding the default GoogleOAuth2 class to get rid of the state error by doing this:
class GoogleOAuth2(google.GoogleOAuth2):
STATE_PARAMETER = False
I've been working on a small project that uses Google OAuth, and it worked perfectly until i had to put it on production. The errors only happen in production and doesnt seem to be related with incorrect URIs because i double checked all of them but i might be wrong
I'm hosting the front-end of my project on GitHub Pages, and the back-end (this Django API) on Heroku. When hosting both on localhost i can log-in normally, but when trying to do it on production, i get the following error:
{non_field_errors: ["Session value state missing."]}
For the looks of it, maybe i was not properly sending the state, but i was, both state and code were being sent correctly
The big difference I noticed between the local payload and the production one are some headers, main difference was the Cookies header missing on the production one, and they had a sessionid and a csrftoken on it, but i could not find any way to send those Cookies on the header, neither the reason of why they aren't being sent to the production API, only the local one
After not having any sucess, i tried the desperate measure of overriding the default GoogleOAuth2 class to get rid of the state error by doing this:
And putting this on settings:
But still, i got the following response from backend:
{non_field_errors: ["Authentication process canceled"]}
Now i'm completely out of ideas, i also tried changing the following settings but neither adding or removing them helped in any form
The text was updated successfully, but these errors were encountered: