Skip to content

Commit

Permalink
Merge pull request #1 from telemark/master
Browse files Browse the repository at this point in the history
Fixes for example.py.
  • Loading branch information
kriben committed May 15, 2015
2 parents 1ac206f + 4ffdb87 commit d76792f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion example.cfg
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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 =

9 changes: 8 additions & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit d76792f

Please sign in to comment.