File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,13 +85,13 @@ in the form of URL string which we use to redirect the user to our identity
8585provider--OneLogin::
8686
8787 from BaseHTTPServer import BaseHTTPRequestHandler
88- from onelogin.saml import AuthRequest
88+ from onelogin.saml import AuthnRequest
8989 ...
9090 class SampleAppHTTPRequestHandler(BaseHTTPRequestHandler):
9191 ...
9292 def do_GET(self):
9393 ...
94- url = AuthRequest .create(**self.settings)
94+ url = AuthnRequest .create(**self.settings)
9595 self.send_response(301)
9696 self.send_header("Location", url)
9797 self.end_headers()
@@ -135,7 +135,7 @@ of the public certificate originally obtained from OneLogin::
135135 valid = res.is_valid()
136136 name_id = res.name_id
137137 if valid:
138- msg = 'The identify of {name_id} has been verified'.format(
138+ msg = 'The identity of {name_id} has been verified'.format(
139139 name_id=name_id,
140140 )
141141 self._serve_msg(200, msg)
Original file line number Diff line number Diff line change 99from BaseHTTPServer import BaseHTTPRequestHandler
1010from BaseHTTPServer import HTTPServer
1111
12- from onelogin .saml import AuthRequest , Response
12+ from onelogin .saml import AuthnRequest , Response
1313
1414__version__ = '0.1'
1515
@@ -57,7 +57,7 @@ def do_GET(self):
5757 self ._bad_request ()
5858 return
5959
60- url = AuthRequest .create (** self .settings )
60+ url = AuthnRequest .create (** self .settings )
6161 self .send_response (301 )
6262 self .send_header ("Location" , url )
6363 self .end_headers ()
@@ -78,7 +78,7 @@ def do_POST(self):
7878 valid = res .is_valid ()
7979 name_id = res .name_id
8080 if valid :
81- msg = 'The identify of {name_id} has been verified' .format (
81+ msg = 'The identity of {name_id} has been verified' .format (
8282 name_id = name_id ,
8383 )
8484 self ._serve_msg (200 , msg )
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ def create(
6161 nsmap = dict (saml = 'urn:oasis:names:tc:SAML:2.0:assertion' ),
6262 )
6363
64- authn_request = samlp_maker .AuthRequest (
64+ authn_request = samlp_maker .AuthnRequest (
6565 ProtocolBinding = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST' ,
6666 Version = '2.0' ,
6767 IssueInstant = now_iso ,
Original file line number Diff line number Diff line change 33from datetime import datetime
44from nose .tools import eq_ as eq
55
6- from onelogin .saml import AuthRequest
6+ from onelogin .saml import AuthnRequest
77
8- class TestAuthRequest (object ):
8+ class TestAuthnRequest (object ):
99 def setUp (self ):
1010 fudge .clear_expectations ()
1111
@@ -24,7 +24,7 @@ def fake_clock():
2424 fake_zlib .remember_order ()
2525 fake_compress = fake_zlib .expects ('compress' )
2626 fake_compress .with_args (
27- """<samlp:AuthRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Version="2.0" IssueInstant="2011-07-09T19:24:52" ID="hex_uuid" AssertionConsumerServiceURL="http://foo.bar/consume"><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">foo_issuer</saml:Issuer><samlp:NameIDPolicy AllowCreate="true" Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"/><samlp:RequestedAuthnContext Comparison="exact"><saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef></samlp:RequestedAuthnContext></samlp:AuthRequest >"""
27+ """<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Version="2.0" IssueInstant="2011-07-09T19:24:52" ID="hex_uuid" AssertionConsumerServiceURL="http://foo.bar/consume"><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">foo_issuer</saml:Issuer><samlp:NameIDPolicy AllowCreate="true" Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"/><samlp:RequestedAuthnContext Comparison="exact"><saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef></samlp:RequestedAuthnContext></samlp:AuthnRequest >"""
2828)
2929 fake_compress .returns ('HDfoo_compressedCHCK' )
3030
@@ -42,7 +42,7 @@ def fake_clock():
4242 )
4343 fake_urlencode .returns ('foo_urlencoded' )
4444
45- req = AuthRequest .create (
45+ req = AuthnRequest .create (
4646 _clock = fake_clock ,
4747 _uuid = fake_uuid_func ,
4848 _zlib = fake_zlib ,
You can’t perform that action at this time.
0 commit comments