django-mama-cas includes a form class for implementing standard username and password authentication. In most cases, this will be the form of authentication required. Trust authentication can be used with CAS, but the requirements are highly implementation dependent.
This is the base form for handling user authentication. It contains the following fields:
The form’s clean() method attempts authentication against the configured authentication backends and verifies that the user account is active. If either check fails, a FormValidation error is raised with an appropriate error message.
Note that this form deviates slightly from the official CAS protocol specification, as documented in Protocol deviations.
The following form classes all inherit from LoginForm, providing additional or alternate behavior during the login process.
A subclass of LoginForm which adds one additional, optional field:
A subclass of LoginForm which adds no additional fields but performs additional cleanup on the username field. If an email address is provided for the username, it extracts only the username portion of the string. Additionally, the username is converted to lowercase for consistency.
This form is used when warning the user that an authentication attempt is taking place. It contains no visible form fields, but contains two hidden fields, service and gateway. This allows the value of these parameters to be passed through the warning process.