如何使用 django-rest-framework 进行社交登录?

How exactly work a social login with django-rest-framework?

我需要创建一个网络服务来登录用户。此 Web 服务将从 Android 或 iOS 应用调用。究竟如何运作?我不知道它是如何工作的?哪一部分调用登录、应用程序或网络服务?我需要使用 Python-Social-Auth?还是本机应用程序进行登录过程并且网络服务保存访问令牌?有人可以指导我登录过程吗?

因此,正如其他评论者所说,除了 python-social-auth 之外,您还可以使用许多其他身份验证。只需通过简单的搜索,我就能找到一个关于将 python-social-auth 与 ios 应用程序结合使用的雪人博客,他们似乎非常喜欢它。他们结合使用 Tasty Pie 并提供了一些代码示例。

https://yeti.co/blog/integrating-django-tastypie-python-social-auth/

我会建议 googling/researching 不同的身份验证系统以及它们如何与 android 和 ios 一起工作,似乎有很多 google 组和博客关于它.如果您希望搜索到 return 最好的结果,请尝试 -

{Insert auth here} with (ios or android) or {insert auth here} auth code for (ios or android)

此外,如果我建议您使用外部第三方身份验证,例如 twitter/google/facebook,请尝试研究 django 社交身份验证。 https://github.com/omab/django-social-auth

这是另一个深入探讨如何使用 django 后端为 ios 设置身份验证的博客,他使用的是 allauth,他的应用程序允许用户通过登录或第三方登录(脸书)检查一下。 http://httplambda.com/a-rest-api-with-django-and-oauthw-authentication/

希望对您有所帮助!