cas_server.federate module
federated mode helper classes
- cas_server.federate.logger = <Logger cas_server.federate (INFO)>
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
provider (cas_server.models.FederatedIendityProvider) – The provider to use for authenticate the user.
service_url (unicode) – The service url to transmit to the
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
- get_logout_url(redirect_url=None)[source]
- Parameters
redirect_url (
unicode
orNoneType
) – 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
against the CAS provider, if valid, create aFederatedUser
matching provider returned username and attributes.- Parameters
ticket (unicode) – The ticket to validate against the provider CAS
- Returns
True
if the validation succeed, elseFalse
.- 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 acas_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 sessionsession_key
.
- clean_sessions(logout_request)[source]
process a SLO request: Search for ticket values in
logout_request
. For each ticket value matching acas_server.models.FederateSLO
, disconnect the corresponding user.- Parameters
logout_request (unicode) – An XML document contening one or more Single Log Out requests.