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

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

Returns:the CAS provider login url
Return type:unicode
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

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.

  • 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.

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.