[英]User authentication using django-oauth-toolkit
I am new to OAuth and Django Rest Framework. 我是OAuth和Django Rest Framework的新手。 I have created a user model in django, now I want to use it on my native mobile application. 我已经在Django中创建了一个用户模型,现在我想在本机移动应用程序上使用它。 So, how do i create authentication using OAuth. 因此,如何使用OAuth创建身份验证。 What flow should I use? 我应该使用什么流量? Do i need to create a client application for every user? 我需要为每个用户创建一个客户端应用程序吗? Please help me with it or provide a nice tutorial. 请帮助我或提供一个不错的教程。 I have read the documentation of django-oauth-toolkit. 我已经阅读了django-oauth-toolkit的文档。 I have understood the basics, but did not understand the implementation. 我了解基本知识,但不了解执行情况。
Follow official django oauth toolkit docs Click Here 关注django oauth官方工具包文档单击此处
Install with pip 用pip安装
pip install django-oauth-toolkit
Add oauth2_provider to your INSTALLED_APPS 将oauth2_provider添加到您的INSTALLED_APPS
INSTALLED_APPS = (
...
'oauth2_provider',
)
If you need an OAuth2 provider you'll want to add the following to your urls.py 如果您需要OAuth2提供程序,则需要将以下内容添加到urls.py中
urlpatterns = [
...
url(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')),
]
then Create an OAuth2 Client Application by using client_id and client_secret 然后使用client_id和client_secret创建一个OAuth2客户端应用程序
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.