diff --git a/example.cfg b/example.cfg index 4342b636..b1c586a6 100644 --- a/example.cfg +++ b/example.cfg @@ -1,3 +1,7 @@ +[app] +host = localhost +port= 9999 + [saml] # Entity id for service provider. # Hint: this is EntityDescriptor.entityID in sp metadata xml from idporten. @@ -18,10 +22,13 @@ idp_sso_target_url = # Hint: This is the SingleLogoutService.Location where Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" logout_target_url = -# The x.509 certificate fingerprint from IDporten as a file path. +# The x.509 certificate file from IDporten as a file path. # Hint: filename should look something like this: idporten-ver2.difi.no-v2.crt idp_cert_file = +# Fingerprint +idp_cert_fingerprint = + # Full path to the service provider's private server key. private_key_file = diff --git a/example.py b/example.py index 8ad9ba0c..97702b91 100644 --- a/example.py +++ b/example.py @@ -57,7 +57,10 @@ def do_GET(self): self._bad_request() return - url = AuthnRequest.create(**self.settings) + settings = self.settings + auth_request = AuthRequest(**self.settings) + url = auth_request.get_signed_url(settings["private_key_file"]) + self.send_response(301) self.send_header("Location", url) self.end_headers() @@ -106,6 +109,10 @@ def main(config_file): port = int(port) settings = dict() + settings['private_key_file'] = config.get( + 'saml', + 'private_key_file' + ) settings['assertion_consumer_service_url'] = config.get( 'saml', 'assertion_consumer_service_url'