Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User authentication using django-oauth-toolkit

I am new to OAuth and Django Rest Framework. I have created a user model in django, now I want to use it on my native mobile application. So, how do i create authentication using 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. I have understood the basics, but did not understand the implementation.

like image 673
rishabsaraf93 Avatar asked Jun 14 '15 13:06

rishabsaraf93


1 Answers

Follow official django oauth toolkit docs Click Here

Install with pip

pip install django-oauth-toolkit

Add oauth2_provider to your INSTALLED_APPS

INSTALLED_APPS = (
    ...
    'oauth2_provider',
)

If you need an OAuth2 provider you’ll want to add the following to your 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

like image 125
SuReSh Avatar answered Oct 01 '22 18:10

SuReSh