Skip to content

Update installation.rst to set LOGIN_URL #469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ Start by making the following changes to your ``settings.py`` file.
AUTHENTICATION_BACKENDS = (
'mozilla_django_oidc.auth.OIDCAuthenticationBackend',
# ...

# Set LOGIN_URL to mozilla_django_oidc's login URL.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajcollins can you maybe rephrase this a bit to indicate that is more of a hint and not a necessary step?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akatsoulas sorry for the delay. Good point. PR updated.

# Views decorated with django.contrib.auth.decorators.login_required decorator
# or class-based views using the LoginRequiredMixin or AccessMixin will
# automatically be redirected to this URL if a user is not logged in.
LOGIN_URL = 'oidc_authentication_init'
)

You also need to configure some OpenID Connect related settings too.
Expand Down Expand Up @@ -144,7 +150,7 @@ Next, edit your ``urls.py`` and add the following:
.. code-block:: python

from django.urls import path, include

urlpatterns = [
# ...
path('oidc/', include('mozilla_django_oidc.urls')),
Expand Down