从rest-auth社交登录获取用户ID

时间:2021-06-17 19:01:22

标签: django django-rest-framework token django-rest-auth python-social-auth

我一直在广泛尝试从 Django rest-auth Google 登录中获取用户 ID。默认响应为:

{
    "key": "6ee5ff4db218a25113f35580d00aeeaf2fe8a2d1"
}

这还不够,我需要有用户 ID。我查看了使用自定义模型序列化程序,但无济于事。我的基于类的观点是:

class GoogleLogin(SocialLoginView):
    adapter_class = GoogleOAuth2Adapter

希望得到这方面的任何指导。谢谢

0 个答案:

没有答案