diff --git a/example/idp/idp.conf b/example/idp/idp_conf.py similarity index 70% rename from example/idp/idp.conf rename to example/idp/idp_conf.py index 8ff14c1..a77e6ae 100644 --- a/example/idp/idp.conf +++ b/example/idp/idp_conf.py @@ -1,18 +1,23 @@ -{ +from saml2 import BINDING_HTTP_REDIRECT +from saml2.saml import NAME_FORMAT_URI + +BASE = "http://localhost:8088/" + +CONFIG={ "entityid" : "urn:mace:umu.se:saml:roland:idp", "service": { "idp": { "name" : "Rolands IdP", "endpoints" : { - "single_sign_on_service" : ["http://localhost:8088/sso"], - "single_logout_service" : [("http://localhost:8088/logout", - 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect')], + "single_sign_on_service" : [BASE+"sso"], + "single_logout_service" : [(BASE+"logout", + BINDING_HTTP_REDIRECT)], }, "policy": { "default": { "lifetime": {"minutes":15}, "attribute_restrictions": None, # means all I have - "name_form": "urn:oasis:names:tc:SAML:2.0:attrname-format:uri" + "name_form": NAME_FORMAT_URI }, "urn:mace:umu.se:saml:roland:sp": { "lifetime": {"minutes": 5}, @@ -23,9 +28,8 @@ "debug" : 1, "key_file" : "pki/mykey.pem", "cert_file" : "pki/mycert.pem", - "xmlsec_binary" : "/usr/local/bin/xmlsec1", "metadata" : { - "local": ["../metadata.xml"], + "local": ["../sp/sp.xml"], }, "organization": { "display_name": "Rolands Identiteter", diff --git a/example/run.sh b/example/run.sh index bfcba8f..8403ab1 100755 --- a/example/run.sh +++ b/example/run.sh @@ -1,17 +1,19 @@ #!/bin/sh -# run.sh -# pysaml2 -# # Created by Roland Hedberg on 3/25/10. # Copyright 2010 UmeƄ Universitet. All rights reserved. -../tools/make_metadata.py sp/sp.conf idp/idp.conf > metadata.xml cd sp -./sp.py sp.conf & +../tools/make_metadata.py sp_conf sp.xml cd ../idp -./idp.py idp.conf & +../tools/make_metadata.py idp_conf idp.xml + +cd ../sp +./sp.py sp_conf & + +cd ../idp +./idp.py idp_conf & cd .. diff --git a/example/sp/sp.conf b/example/sp/sp_conf.py similarity index 64% rename from example/sp/sp.conf rename to example/sp/sp_conf.py index eaafad8..90e42d6 100644 --- a/example/sp/sp.conf +++ b/example/sp/sp_conf.py @@ -1,14 +1,20 @@ -{ +from saml2 import BINDING_HTTP_REDIRECT +from saml2.saml import NAME_FORMAT_URI + +BASE= "http://localhost:8087/" + +CONFIG = { "entityid" : "urn:mace:umu.se:saml:roland:sp", "service": { "sp":{ "name" : "Rolands SP", "endpoints":{ - "assertion_consumer_service": ["http://localhost:8087/"], - "single_logout_service" : [("http://localhost:8087/slo", - 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect')], + "assertion_consumer_service": [BASE], + "single_logout_service" : [(BASE+"slo", + BINDING_HTTP_REDIRECT)], }, - "required_attributes": ["surname", "givenname", "edupersonaffiliation"], + "required_attributes": ["surname", "givenname", + "edupersonaffiliation"], "optional_attributes": ["title"], "idp": { "urn:mace:umu.se:saml:roland:idp": None, @@ -18,10 +24,9 @@ "debug" : 1, "key_file" : "pki/mykey.pem", "cert_file" : "pki/mycert.pem", - "xmlsec_binary" : "/user/local/bin/xmlsec1", "attribute_map_dir" : "./attributemaps", "metadata" : { - "local": ["../metadata.xml"], + "local": ["../idp/idp.xml"], }, # -- below used by make_metadata -- "organization": { @@ -36,5 +41,5 @@ "contact_type": "technical", }, ], - "name_form": "urn:oasis:names:tc:SAML:2.0:attrname-format:uri" + "name_form": NAME_FORMAT_URI } \ No newline at end of file