Skip to content

Commit

Permalink
Actualize docs about AuthenticationMiddleware (#1267)
Browse files Browse the repository at this point in the history
* actualize docs about AuthenticationMiddleware

* add myself to authors
  • Loading branch information
Akay7 committed May 8, 2023
1 parent 9dd1033 commit 25f6de5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Dulmandakh Sukhbaatar
Dylan Giesler
Dylan Tack
Eduardo Oliveira
Egor Poderiagin
Emanuele Palazzetti
Federico Dolce
Frederico Vieira
Expand Down
10 changes: 5 additions & 5 deletions docs/tutorial/tutorial_03.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ which takes care of token verification. In your settings.py:
MIDDLEWARE = [
'...',
# If you use SessionAuthenticationMiddleware, be sure it appears before OAuth2TokenMiddleware.
# SessionAuthenticationMiddleware is NOT required for using django-oauth-toolkit.
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
# If you use AuthenticationMiddleware, be sure it appears before OAuth2TokenMiddleware.
# AuthenticationMiddleware is NOT required for using django-oauth-toolkit.
'django.contrib.auth.middleware.AuthenticationMiddleware',
'oauth2_provider.middleware.OAuth2TokenMiddleware',
'...',
]
Expand All @@ -44,8 +44,8 @@ not used at all, it will try to authenticate user with the OAuth2 access token a
`request.user` and `request._cached_user` fields so that AuthenticationMiddleware (when active)
will not try to get user from the session.

If you use SessionAuthenticationMiddleware, be sure it appears before OAuth2TokenMiddleware.
However SessionAuthenticationMiddleware is NOT required for using django-oauth-toolkit.
If you use AuthenticationMiddleware, be sure it appears before OAuth2TokenMiddleware.
However AuthenticationMiddleware is NOT required for using django-oauth-toolkit.

Protect your view
-----------------
Expand Down

0 comments on commit 25f6de5

Please sign in to comment.