|
1 | 1 | # -*- coding: utf-8 -*- |
2 | 2 |
|
3 | | -# Copyright (c) 2014, OneLogin, Inc. |
4 | | -# All rights reserved. |
| 3 | +""" OneLogin_Saml2_Authn_Request class |
| 4 | +
|
| 5 | +Copyright (c) 2014, OneLogin, Inc. |
| 6 | +All rights reserved. |
| 7 | +
|
| 8 | +AuthNRequest class of OneLogin's Python Toolkit. |
| 9 | +
|
| 10 | +""" |
5 | 11 |
|
6 | 12 | from base64 import b64encode |
7 | 13 | from zlib import compress |
|
10 | 16 | from onelogin.saml2.constants import OneLogin_Saml2_Constants |
11 | 17 |
|
12 | 18 |
|
13 | | -class OneLogin_Saml2_Authn_Request: |
| 19 | +class OneLogin_Saml2_Authn_Request(object): |
| 20 | + """ |
| 21 | +
|
| 22 | + This class handles an AuthNRequest. It builds an |
| 23 | + AuthNRequest object. |
| 24 | +
|
| 25 | + """ |
14 | 26 |
|
15 | 27 | def __init__(self, settings): |
16 | 28 | """ |
@@ -62,15 +74,16 @@ def __init__(self, settings): |
62 | 74 | <samlp:RequestedAuthnContext Comparison="exact"> |
63 | 75 | <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef> |
64 | 76 | </samlp:RequestedAuthnContext> |
65 | | -</samlp:AuthnRequest>""" % { |
66 | | - 'id': uid, |
67 | | - 'provider_name': provider_name_str, |
68 | | - 'issue_instant': issue_instant, |
69 | | - 'destination': destination, |
70 | | - 'assertion_url': sp_data['assertionConsumerService']['url'], |
71 | | - 'entity_id': sp_data['entityId'], |
72 | | - 'name_id_policy': name_id_policy_format, |
73 | | - } |
| 77 | +</samlp:AuthnRequest>""" % \ |
| 78 | + { |
| 79 | + 'id': uid, |
| 80 | + 'provider_name': provider_name_str, |
| 81 | + 'issue_instant': issue_instant, |
| 82 | + 'destination': destination, |
| 83 | + 'assertion_url': sp_data['assertionConsumerService']['url'], |
| 84 | + 'entity_id': sp_data['entityId'], |
| 85 | + 'name_id_policy': name_id_policy_format, |
| 86 | + } |
74 | 87 |
|
75 | 88 | self.__authn_request = request |
76 | 89 |
|
|
0 commit comments