Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example.py gives errors about authnrequest #1

Merged
merged 3 commits into from
May 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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