common.services.cas package¶
Submodules¶
common.services.cas.cli module¶
CAS CLI interface
Author: Bob Droege
-
exception
common.services.cas.cli.
CASError
¶ Bases:
Exception
-
class
common.services.cas.cli.
CASHTMLParser
¶ Bases:
html.parser.HTMLParser
Parser for CAS login pages. It will search for form input fields that have a name attribute equal to lt or execution and store the corresponding value attributes. These fields are required to do a CAS login attempt. The values are stored as class attributes.
-
get_attr
(attrs, key)¶
-
handle_starttag
(tag, attrs)¶
-
-
class
common.services.cas.cli.
NoRedirection
¶ Bases:
urllib.request.HTTPErrorProcessor
-
http_response
(request, response)¶
-
https_response
(request, response)¶
-
-
common.services.cas.cli.
get_service_ticket
(username, password, service_url, server='https://cas.cosmos.esa.int/cas')¶ get_service_ticket obtains a CAS service ticket by running the login procedure with a service url. It returns the value of the Service Ticket.
username: CAS username password: CAS password service_url: URL of the service that will make use of the service ticket server: CAS server URL
-
common.services.cas.cli.
login
(username, password, service_url=None, server='https://cas.cosmos.esa.int/cas')¶ login performs a login action by fetching the CAS login page using a GET, finding some hidden values in the form, and submitting the form using a POST. It returns the value of the CAS Ticket Granting Cookie and, if applicable, the Service Ticket.
username: CAS username password: CAS password service_url: URL of the service that wants to authenticate the user against the CAS server server: CAS server URL