Как получить доступ к токену после входа в систему с помощью google dj_rest_auth
Когда я посещаю этот url https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=<CALLBACK_URL_YOU_SET_ON_GOOGLE>&prompt=consent&response_type=token&client_id=&scope=openid%20email%20profile
в ответ я получил
"успех"
Но я хочу получить access_token, который отображается в url, как
{
"token":tokenkey
}
может кто-нибудь подскажет мне, как это сделать?
И мой код выглядит следующим образом
В urls.py
from users.views import GoogleLogin,GoogleRedirect
path('auth/google/', GoogleLogin.as_view(), name='google_login'),
path('accounts/google/login/callback/', GoogleRedirect.as_view())
в views.y
class GoogleLogin(SocialLoginView):
adapter_class = GoogleOAuth2Adapter
client_class = OAuth2Client
class GoogleRedirect(APIView):
def get(self, request):
return Response("success")
'''