-
Notifications
You must be signed in to change notification settings - Fork 12
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
Minimal Login Example #15
Comments
Could you share your settings and Django version? From the shared descriptions I am not seeing anything wrong jumping out at me :( What I did not fully understand is whether you see the call go to the KrbBackend or not? |
I too wish there was more information available on how to implement this. Like:
Fiddled around with it for a couple of hours and read through the Microsoft documentation on how to setup IIS to do Kerberos authentication, but feeling like I'm missing something here and setup is harder than it has to be. |
I'm trying to use the django-auth-kerberos library - thanks a lot for putting it together - for a project requiring kerberos authentication. Would it be possible to add a minimal working example of a Python login class to use with the library (for instance, to use in Django's views.py or forms.py)?
The KrbBackend authentication class does work fine in the Django shell. The kinit command works fine from my OS shell, too. It seems everything should work well. Yet, whenever I try to create a login page to use my actual Django app with kerberos authentication, I am unable to make it work. My guess is that Django falls back (for some reason that I can't figure out) to its own backend, despite the fact that I have arranged my settings.py file as indicated.
My goal is to have the user start on a login page, then check the credentials they enter with Kerberos, and log them to the site if successful. This seems like a typical use case.
I've tried creating a custom class overriding Django's AuthenticationForm, e.g.:
with the necessary urls set up, but that won't work. The login always returns the invalid_login error message - in fact, the POST request never makes it to KrbBackend. I've also tried a custom login function in views.py, which I don't like per se, but that won't work either, e.g.:
The Django documentation for external authentication is of little help [https://docs.djangoproject.com/en/2.1/howto/auth-remote-user/] as they propose an entirely different approach based on their RemoteUserBackend.
I get that I'm doing something wrong here, but my sense is that a minimal example would be really helpful for anyone looking to use the library.
The text was updated successfully, but these errors were encountered: