When I visit this 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
in response I got
"success"
But I want to get access_token that shown in url,just like
{
"token":tokenkey
}
can someone tell me how to do that?
And my code look likes
In 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())
in views.y
class GoogleLogin(SocialLoginView):
adapter_class = GoogleOAuth2Adapter
client_class = OAuth2Client
class GoogleRedirect(APIView):
def get(self, request):
return Response("success")
'''