Closed Nizzy94 closed 1 year ago
Thanks for pointing at this patch (I don't know what the PS1 is used for in the response header but at least you can reconnect an existing user).
For anyone trying to remove the PS1 header you have to add
if (k!='PS1'):
just below
for k, v in headers.items():
Are you sure you configured your Google Credentials and the application well? I just created one app for testing purposes and I am using google oauth. As you can see, it passes just fine.
Describe the bug I got access_token from google which I'm supposed to use to authenticate users. Everything works fine when the user is authenticating for the first time. But when the user logs out and tries to login again, it gives this wired error.
This never happened when I was using the old gapi for login. I am currently using the new recommended GSI google provided.
To Reproduce Steps to reproduce the behavior: I have created a Demo Repo for this. Clone it and run
pip install -r requirements.txt
and you're good to go NB: Don't forget to create a virtual env before installation.Expected behavior A response with JSON data of tokens generated by the backend
Screenshots
Additional context I used to work with the Old gapi.$Auth system.
The issue appears to be coming from ConvertTokenView class in site-packages/drf_social_oauth2.py. When a user registers for the first time, these are the headers:
when the same user tries to access convert-token endpoint, a
PS1
header is added(which contains the badHeader) together with other headers. Below is the full list of headers:So I went into drf_social_oauth2/views/ConvertTokenView.post() to manually remove the PS1 header from the response headers and it works fine. I know this isn't ideal so I'd like suggestions for a better way. If this is a bug on the module, please get it fixed.