Skip to content

Conversation

@ajcollins
Copy link

Update docs to set LOGIN_URL, which enables django's login_required decorator to use mozilla-django-keycloak's login URL.

Setting LOGIN_URL enables django's login_required decorator to use mozilla-django-keycloak's login URL.
@akatsoulas
Copy link
Collaborator

@ajcollins thank you for this PR!

Could you maybe explain why this needs to be part of the documentation? Probably there is a typo here too as you mention keycloak in your commit

@ajcollins
Copy link
Author

@akatsoulas thank you for considering it and for the very helpful project. Sorry for the lack of clarity and typo.

I proposed the change as, after following the mozilla_django_oidc installation instructions, views decorated with django's @login_required decorator did not redirect me to authenticate through the OIDC provider. Instead redirecting to the default /accounts/login/.

I realise that many will add OIDC support having already set LOGIN_URL and realise that they need to update this. However, it wasn't obvious when adding OIDC support at the start of the project. Including it in the installation instructions would have set me on happy-path straight away.

I've fixed the typo and updated the comment in the code. Hopefully this improves the clarity.

@akatsoulas
Copy link
Collaborator

Thanks @ajcollins for clarifying this!

'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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants