Redirect to login view instead of partially reimplementing it. Remove unusable flows...
[django-cas-provider.git] / README.rst
index d7bed27..b093c3f 100644 (file)
@@ -23,9 +23,11 @@ USAGE
 ======
 
 #. Add ``'cas_provider'`` to your ``INSTALLED_APPS`` tuple in *settings.py*.
 ======
 
 #. Add ``'cas_provider'`` to your ``INSTALLED_APPS`` tuple in *settings.py*.
-#. In *settings.py*, set ``LOGIN_URL`` to ``'/cas/login/'`` and ``LOGOUT_URL`` to ``'/cas/logout/'``
-#. In *urls.py*, put the following line: ``(r'^cas/', include('cas_provider.urls')),``
-#. Create login/logout templates (or modify the samples)
+#. In *urls.py*, put the following line: ``path('cas/', include('cas_provider.urls')),``
+#. Set up a regular Django login view (e.g. ``django.contrib.auth.views.LoginView``,
+   included in ``django.contrib.auth.urls``) and point ``LOGIN_URL`` to it.
+   ``LOGIN_URL`` must *not* point to the CAS login endpoint.
+#. Create logout and warn templates (or modify the samples)
 #. Use 'cleanuptickets' management command to clean up expired tickets
 
 SETTINGS
 #. Use 'cleanuptickets' management command to clean up expired tickets
 
 SETTINGS
@@ -62,11 +64,17 @@ PROVIDED VIEWS
 login
 ---------
 
 login
 ---------
 
+This is the CAS login endpoint (``/login?service=...``). It doesn't display a login form:
+if the user is not authenticated, it redirects to ``settings.LOGIN_URL``
+with ``next`` pointing back to itself. Once the user is authenticated, it issues
+a Service Ticket and redirects to the service.
+
+The ``renew`` and ``gateway`` parameters are not supported.
+
 It has not required arguments.
 
 Optional arguments:
 
 It has not required arguments.
 
 Optional arguments:
 
-* template_name - login form template name (default is 'cas/login.html')
 * success_redirect - redirect after successful login if service GET argument is not provided
    (default is settings.LOGIN_REDIRECT_URL)
 * warn_template_name - warning page template name to allow login user to service if he
 * success_redirect - redirect after successful login if service GET argument is not provided
    (default is settings.LOGIN_REDIRECT_URL)
 * warn_template_name - warning page template name to allow login user to service if he