summaryrefslogtreecommitdiffstats
path: root/authentic2_idp_cas/constants.py
diff options
context:
space:
mode:
Diffstat (limited to 'authentic2_idp_cas/constants.py')
-rw-r--r--authentic2_idp_cas/constants.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/authentic2_idp_cas/constants.py b/authentic2_idp_cas/constants.py
index b90c10b..417bdd6 100644
--- a/authentic2_idp_cas/constants.py
+++ b/authentic2_idp_cas/constants.py
@@ -42,6 +42,9 @@ PROXY_TICKET_ELT = 'proxyTicket'
PROXY_FAILURE_ELT = 'proxyFailure'
+# XML Elements for CAS 3.0
+ATTRIBUTES_ELT = 'attributes'
+
# Templates
CAS10_VALIDATION_FAILURE = 'no\n\n'
@@ -56,3 +59,42 @@ CAS20_VALIDATION_SUCCESS = '''<cas:serviceResponse xmlns:cas='http://www.yale.ed
<cas:user>%s</cas:user>
</cas:authenticationSuccess>
</cas:serviceResponse>'''
+
+SAML_RESPONSE_TEMPLATE = '''<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
+<SOAP-ENV:Header/>
+<SOAP-ENV:Body>
+<Response xmlns="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" IssueInstant="2013-05-16T16:07:35Z" MajorVersion="1" MinorVersion="1" Recipient="https://amonecole.monreseau.lan/webcalendar/login.php" ResponseID="{reponse_id}">
+ <Status>
+ <StatusCode Value="samlp:Success">
+ </StatusCode>
+ </Status>
+ <Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion" AssertionID="{assertion_id}" IssueInstant="{issue_instant}" Issuer="{issuer}" MajorVersion="1" MinorVersion="1">
+<Conditions NotBefore="{not_before}" NotOnOrAfter="{not_on_or_after}">
+ <AudienceRestrictionCondition>
+ <Audience>{audience}</Audience>
+ </AudienceRestrictionCondition>
+ </Conditions>
+ <AttributeStatement>
+ <Subject>
+ <NameIdentifier>{name_id}</NameIdentifier>
+ <SubjectConfirmation>
+ <ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:artifact</ConfirmationMethod>
+ </SubjectConfirmation>
+ </Subject>
+ {attributes}
+
+ </AttributeStatement>
+ <AuthenticationStatement AuthenticationInstant="{authentication_instant}" AuthenticationMethod="{authentication_method}">
+ <Subject>
+ <NameIdentifier>{name_id}</NameIdentifier>
+ <SubjectConfirmation>
+ <ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:artifact</ConfirmationMethod>
+ </SubjectConfirmation>
+ </Subject>
+ </AuthenticationStatement>
+ </Assertion>
+</Response>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>'''
+