title: Form-based Kerberos authentication in Django
body: <p>I have got an Django application that uses the <code>RemoteUserBackend</code> in combination with Apache and mod_auth_kerb to authenticate against Kerberos.</p>
  
  <p>However, this has some drawbacks:</p>
  
  <ol>
  <li>There is <strong>no proper logout</strong> without closing the browser tab. You may click "Logout" in your Django application, but I would expect to be asked for my credentials when I try to log in again - the latter is not the case. (Side note: It is quite possible for my application that two users want to log in one after another, which increases the lack of comfort and may be problematic when one users performs actions with the other user's rights.)</li>
  <li>The application is currently tailored to the Apache/RemoteUser solution, so it does provide <strong>no flexibility to switch over to other authentication methods</strong>, e.g. authentication against the Django database. The possibility to use alternative authentication methods would also ease the development of the application.</li>
  </ol>
  
  <p>That said, I would like to use a form-based authentication (username/password). This would move the control for the authentication to Django, so login/logout should work properly then. Also, this form could be used as well with different authentication backends, without a need to modify the GUI.</p>
  
  <p>How can this be done? Is there already a solution to this or a project that adresses my issue? Most implementations I saw <a href="https://stackoverflow.com/questions/3401512/ntlm-kerberos-authentication-in-django">like the ones in the answers here</a> just use Apache or an LDAP authentication, but not Kerberos.</p>
  
  <p><em>Related, but unanswered question: <a href="https://stackoverflow.com/q/12588109/1388240">Django user logout with remote authentication</a></em></p>