Index: django/contrib/auth/views.py
===================================================================
--- django/contrib/auth/views.py	(revision 9050)
+++ django/contrib/auth/views.py	(working copy)
@@ -14,11 +14,13 @@
 from django.contrib.auth.models import User
 from django.views.decorators.cache import never_cache
 
-def login(request, template_name='registration/login.html', redirect_field_name=REDIRECT_FIELD_NAME):
+def login(request, template_name='registration/login.html',
+          redirect_field_name=REDIRECT_FIELD_NAME,
+          authentication_form=AuthenticationForm):
     "Displays the login form and handles the login action."
     redirect_to = request.REQUEST.get(redirect_field_name, '')
     if request.method == "POST":
-        form = AuthenticationForm(data=request.POST)
+        form = authentication_form(data=request.POST)
         if form.is_valid():
             # Light security check -- make sure redirect_to isn't garbage.
             if not redirect_to or '//' in redirect_to or ' ' in redirect_to:
@@ -29,7 +31,7 @@
                 request.session.delete_test_cookie()
             return HttpResponseRedirect(redirect_to)
     else:
-        form = AuthenticationForm(request)
+        form = authentication_form(request)
     request.session.set_test_cookie()
     if Site._meta.installed:
         current_site = Site.objects.get_current()
Index: docs/topics/auth.txt
===================================================================
--- docs/topics/auth.txt	(revision 9050)
+++ docs/topics/auth.txt	(working copy)
@@ -523,11 +523,9 @@
     :func:`~django.contrib.auth.authenticate()`
     sets an attribute on the :class:`~django.contrib.auth.models.User` noting
     which authentication backend successfully authenticated that user (see
-    the `backends documentation`_ for details), and this information is
-    needed later during the login process.
+    :ref:`authentication-backends` for details), and this information is needed
+    later during the login process.
 
-.. _backends documentation: #other-authentication-sources
-
 Manually checking a user's password
 -----------------------------------
 
@@ -717,6 +715,15 @@
 
         {% endblock %}
 
+    **New in Django development version**
+
+    If you are using alternate authentication (see
+    :ref:`authentication-backends`) you can pass a custom authentication form
+    to the login view via the ``authentication_form`` parameter. This form must
+    accept a ``request`` keyword argument in its ``__init__`` method, and
+    provide a ``get_user`` argument which returns the authenticated user object
+    (this method is only ever called after successful form validation).
+
     .. _forms documentation: ../forms/
     .. _site framework docs: ../sites/
 
