Django Allauth Bad Request Error, Error Retrieving Access Token: Invalid Grant

I am using Django Allauth from PyPi in a Django project to authenticate users so they can upload YouTube videos. The way I do this is with a button on the login page that should collect tokens from Google to upload the videos. I am able to send the user to Google for authentication, but I get an error in the Allauth view when the user is returned to the website.

{'provider': 'google', 'code': 'unknown', 'exception': OAuth2Error('Error retrieving access token: b\'{\\n "error": "invalid_grant",\\n "error_description": "Bad Request"\\n}\'')}

Any idea how to fix this? I have used django-allauth before without any trouble. For reference, the full source code I am using to produce this error is on my github at https://github.com/daisycamber/femmebabe-2024. Thank you for your help.

Update: I tried on a mobile client and I got a similar, just as cryptic error. This is the error:

{'provider': <allauth.socialaccount.providers.google.provider.GoogleProvider object at 0x7f4c1b79b6a0>, 'code': 'unknown', 'exception': OAuth2Error('Error retrieving access token: b\'{\\n "error": "invalid_grant",\\n "error_description": "Bad Request"\\n}\'')}
Back to Top