cas_server.forms module

forms for the app

class cas_server.forms.BootsrapForm(*args, **kwargs)[source]

Form base class to use boostrap then rendering the form fields

class cas_server.forms.WarnForm(*args, **kwargs)[source]

Bases: django.forms.Form

Form used on warn page before emiting a ticket

service = None

The service url for which the user want a ticket

renew = None

Is the service asking the authentication renewal ?

gateway = None

Url to redirect to if the authentication fail (user not authenticated or bad service)

warned = None

True if the user has been warned of the ticket emission

lt = None

A valid LoginTicket to prevent POST replay

class cas_server.forms.FederateSelect(*args, **kwargs)[source]

Bases: django.forms.Form

Form used on the login page when settings.CAS_FEDERATE is True allowing the user to choose an identity provider.

provider = None

The providers the user can choose to be used as authentication backend

service = None

The service url for which the user want a ticket

remember = None

A checkbox to remember the user choices of provider

warn = None

A checkbox to ask to be warn before emiting a ticket for another service

renew = None

Is the service asking the authentication renewal ?

class cas_server.forms.UserCredential(*args, **kwargs)[source]

Bases: django.forms.Form

Form used on the login page to retrive user credentials

username = None

The user username

service = None

The service url for which the user want a ticket

password = None

The user password

lt = None

A valid LoginTicket to prevent POST replay

warn = None

A checkbox to ask to be warn before emiting a ticket for another service

renew = None

Is the service asking the authentication renewal ?

clean()[source]

Validate that the submited username and password are valid

Raises:django.forms.ValidationError – if the username and password are not valid.
Returns:The cleaned POST data
Return type:dict
class cas_server.forms.FederateUserCredential(*args, **kwargs)[source]

Bases: UserCredential

Form used on a auto submited page for linking the views FederateAuth and LoginView.

On successful authentication on a provider, in the view FederateAuth a FederatedUser is created by cas_server.federate.CASFederateValidateUser.verify_ticket() and the user is redirected to LoginView. This form is then automatically filled with infos matching the created FederatedUser using the ticket as one time password and submited using javascript. If javascript is not enabled, a connect button is displayed.

This stub authentication form, allow to implement the federated mode with very few modificatons to the LoginView view.

username = None

the user username with the @ component

service = None

The service url for which the user want a ticket

password = None

The ticket used to authenticate the user against a provider

ticket = None

alias of password

lt = None

A valid LoginTicket to prevent POST replay

warn = None

Has the user asked to be warn before emiting a ticket for another service

renew = None

Is the service asking the authentication renewal ?

clean()[source]

Validate that the submited username and password are valid using the CASFederateAuth auth class.

Raises:django.forms.ValidationError – if the username and password do not correspond to a FederatedUser.
Returns:The cleaned POST data
Return type:dict
class cas_server.forms.TicketForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None)[source]

Bases: django.forms.ModelForm

Form for Tickets in the admin interface