From the course: Building Angular and Django Apps

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Setting up Authentication with Django OAuth Toolkit

Setting up Authentication with Django OAuth Toolkit

From the course: Building Angular and Django Apps

Start my 1-month free trial

Setting up Authentication with Django OAuth Toolkit

- [Instructor] Our app is designed for administrators and tour operators to use. This means we're going to need authentication. Django OAUTH Tool Kit provides an easy way to add OAUTH token based authentication. We need to update the middleware setting in our settings pi file. And we add oauth2_provider.middleware. And then we need to find the authentication backend setting. We're going to remove the no authentication backend that we've been using. And we're going to insert an oauth2_provider.backend. We must configure the oauth2 provider, specifically the backend class because we are going to be using JSON data payloads with this rest API server. And then we have to configure Django rest framework to no longer use the no authentication backend and instead to use the oauth2_provider rest framework specific oauth2 authentication.

Contents