This PR addresses the OAuth authentication issue with drf_social_oauth2 in the Django project. Users were unable to properly authenticate and login using OAuth providers like Facebook and Google. The issue was caused by invalid OAuth credentials, improper middleware setup, incorrect app whitelisting/validation, and potential CSRF validation issues.
Changes Made
Verified and updated the OAuth credentials for Facebook and Google in the settings.py file to ensure they match the credentials provided by the OAuth providers.
Reviewed and corrected the middleware setup for drf_social_oauth2 according to the documentation to ensure proper authentication flow.
Whitelisted the app domains/origins in the OAuth providers to allow successful authentication.
Checked for CSRF validation issues when redirecting back from the OAuth provider and made necessary tweaks to the CSRF settings and OAuth2CallbackView to resolve the issue.
Please review and test the changes to ensure proper OAuth authentication using drf_social_oauth2.
Fixes #6.
To checkout this PR branch, run the following command in your terminal:
git checkout sweep/fix-oauth-authentication
To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.
Description
This PR addresses the OAuth authentication issue with
drf_social_oauth2
in the Django project. Users were unable to properly authenticate and login using OAuth providers like Facebook and Google. The issue was caused by invalid OAuth credentials, improper middleware setup, incorrect app whitelisting/validation, and potential CSRF validation issues.Changes Made
settings.py
file to ensure they match the credentials provided by the OAuth providers.drf_social_oauth2
according to the documentation to ensure proper authentication flow.OAuth2CallbackView
to resolve the issue.Please review and test the changes to ensure proper OAuth authentication using
drf_social_oauth2
.Fixes #6.
To checkout this PR branch, run the following command in your terminal:
To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.