Closed adrenaline681 closed 9 months ago
Having the same issue, did you find the cause?
No, I ended up using Implicit flow instead since I only needed to get user information on login.
class GoogleLoginView(SocialLoginView):
adapter_class = GoogleOAuth2Adapter
I'm leaving the solution that helped me. I've lost so many hours maybe this can help someone else save some time.
The trick was to set the callback_url to postmessage
class GoogleLoginView(SocialLoginView):
adapter_class = GoogleOAuth2Adapter
callback_url = 'postmessage'
client_class = OAuth2Client
1) On my frontend (ReactJs) I'm login using Google and getting the "code" using the Auth Code Flow which looks something like this:
2) Then I'm sending this in the body of a POST request to my DRF API which lands on this view:
3) In my Google Console I have the same callback URL setup under OAuth 2.0 Client IDs:
4) But I keep getting the same error: