53 lines
1.6 KiB
Python
Executable File
53 lines
1.6 KiB
Python
Executable File
#!/usr/bin/env python
|
|
from saml2.saml import AUTHN_PASSWORD
|
|
|
|
__author__ = 'rolandh'
|
|
|
|
import json
|
|
|
|
BASE = "http://localhost:8087"
|
|
#BASE= "http://lingon.catalogix.se:8087"
|
|
|
|
metadata = open("./sp/sp.xml").read()
|
|
|
|
AUTHN = {"class_ref": AUTHN_PASSWORD,
|
|
"authn_auth": "http://lingon.catalogix.se/login"}
|
|
|
|
info = {
|
|
"start_page": BASE,
|
|
"entity_id": "%s/sp.xml" % BASE,
|
|
"result": {
|
|
"matches": {
|
|
"content": "<h2>Your identity are"
|
|
},
|
|
},
|
|
"metadata": metadata,
|
|
"args":
|
|
{
|
|
"AuthnResponse": {
|
|
"sign_assertion": "always", # always, never
|
|
"sign_response": "never", # always, never
|
|
"authn": AUTHN
|
|
}
|
|
},
|
|
# This is the set of attributes and values that are returned in the
|
|
# SAML Assertion
|
|
"identity": {
|
|
"given_name": "Roland",
|
|
"sn": "Hedberg"
|
|
},
|
|
# This is the value of the NameID that is return in the Subject in the
|
|
# Assertion
|
|
"userid": "roland",
|
|
# regex pattern that must be contained in the resulting echo page to validate
|
|
# that the SP returned the right page after Login.
|
|
"echopageIdPattern": r"<title>SAML Echo Service</title>",
|
|
# list of regex patterns that must be contained in the resulting echo page to validate
|
|
# that the SP's echo page returns expected SAMLe response values (e.g. attribute values)
|
|
"echopageContentPattern": [r"Given Name\s*</td>\s*<td>Roland</td>",
|
|
r"Userid\s*</td>\s*<td>roalnd</td>",
|
|
r"Surname\s*</td>\s*<td>Hedberg</td>",
|
|
]
|
|
}
|
|
|
|
print json.dumps(info) |