-
Notifications
You must be signed in to change notification settings - Fork 75
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
Using django-shibboleth-remoteuser with LoginRequiredMixin from Django Braces #41
Comments
Normally what we do with this package is to have the whole site protected by Shib, even if a valid session isn't required for every page. So, for example, we would have something like this:
Does that fix the issue for you? If it does, would you still need a different solution, or are you OK with that? |
Just FYI, I haven't forgotten this. This got us part of the way there, but we're working on a solution which may help others. We're working on protecting a single Django URL route with Shib, then allowing Django's login_required() to handle the rest. We're also including an example where anything with login_required() is protected by Shib, but a single URL route/view uses Django's auth instead. I'll post it here when we get it, and issue a PR for the README, in case it might help. Thanks for all your efforts! |
Great! |
Please try the latest code with PR #43, and see if that helps this issue. |
@FlipperPA and @bcail is this still an active issue? |
I'm attempting to use django-shibboleth-remoteuser with the permission mixins from Django braces. However, it seems that the session is being lost after the first click. We had a similar issue with CoSign authentication using remote user, which was solved by using the new PersistentRemoteUserMiddleware:
https://docs.djangoproject.com/en/1.9/ref/middleware/#django.contrib.auth.middleware.PersistentRemoteUserMiddleware
We are trying to use the LoginRequiredMixin to protect the site to keep it controlled by Django (so that we could fall back on Django's auth, for example, if Shib isn't available for any reason), and only protect the LOGIN_URL ('/Shibboleth.sso/Login') with Shibboleth's gatekeeper.
I'm not sure the problem is the same, as this is my first time using Shibboleth. We have shibboleth with Apache successfully redirecting to our IdP for login, and when it returns, it creates the user and we've dumped {{ request.username }} successfully into a template. However, on ensuing clicks, it is no longer populated. I'm wondering if anyone has run into this problem. I'm including various settings and code snippets below.
Apache config:
Relevant Django settings:
urlpatterns:
Example views for the 'about' Django app:
Our Shibboleth XML files would seem to be okay since we can hit https://vagrant.ourserver.com/Shibboleth.sso/Login and successfully auth with our IdP, and see the returned user created. We're on CentOS 7.2 with Apache 2.4. Apologies if this isn't the right place to ask, and let me know if I should include more details. Thanks in advance.
The text was updated successfully, but these errors were encountered: