I'm using django-rest-auth
for social auth via API.
I've configured Facebook and it works perfectly but I've got some issues with Google social auth.
- I've added to
INSTALLED_APPS
:
allauth.socialaccount.providers.google',
- Created views:
from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter
from allauth.socialaccount.providers.oauth2.client import OAuth2Client
class CustomGoogleOAuth2Adapter(GoogleOAuth2Adapter):
basic_auth = False
class GoogleLogin(SocialLoginView):
adapter_class = CustomGoogleOAuth2Adapter
client_class = OAuth2Client
- Created app by admin panel
- I've got
access_token
from https://developers.google.com/oauthplayground/ - When I tried to log in by endpoint I got an error:
Reverse for 'redirect' not found. 'redirect' is not a valid view function or pattern name.
views.py
file? – Demetrisurls.py
– anjaneyulubatta505