cas_server.federate module

federated mode helper classes

cas_server.federate.logger = <logging.Logger object>

logger facility

class cas_server.federate.CASFederateValidateUser(provider, service_url, renew=False)[source]

Bases: object

Class CAS client used to authenticate the user again a CAS provider

Parameters:
username = None

the provider returned username

attributs = {}

the provider returned attributes

federated_username = None

the provider returned username this the provider suffix appended

provider = None

the identity provider

client = None

the CAS client instance

get_login_url()[source]
Returns:the CAS provider login url
Return type:unicode
get_logout_url(redirect_url=None)[source]
Parameters:redirect_url (unicode or NoneType) – The url to redirect to after logout from the provider, if provided.
Returns:the CAS provider logout url
Return type:unicode
verify_ticket(ticket)[source]

test ticket agains the CAS provider, if valid, create a FederatedUser matching provider returned username and attributes.

Parameters:ticket (unicode) – The ticket to validate against the provider CAS
Returns:True if the validation succeed, else False.
Return type:bool
static register_slo(username, session_key, ticket)[source]

association a ticket with a (username, session_key) for processing later SLO request by creating a cas_server.models.FederateSLO object.

Parameters:
  • username (unicode) – A logged user username, with the @ component.
  • session_key (unicode) – A logged user session_key matching username.
  • ticket (unicode) – A ticket used to authentication username for the session session_key.
clean_sessions(logout_request)[source]

process a SLO request: Search for ticket values in logout_request. For each ticket value matching a cas_server.models.FederateSLO, disconnect the corresponding user.

Parameters:logout_request (unicode) – An XML document contening one or more Single Log Out requests.