File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,6 +63,23 @@ class RequestTest < Test::Unit::TestCase
6363 assert_match /<samlp:AuthnRequest[^<]* IsPassive='true'/ , inflated
6464 end
6565
66+ should "create the SAMLRequest URL parameter with ProtocolBinding" do
67+ settings = Onelogin ::Saml ::Settings . new
68+ settings . idp_sso_target_url = "http://example.com"
69+ settings . protocol_binding = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'
70+ auth_url = Onelogin ::Saml ::Authrequest . new . create ( settings )
71+ assert auth_url =~ /^http:\/ \/ example\. com\? SAMLRequest=/
72+ payload = CGI . unescape ( auth_url . split ( "=" ) . last )
73+ decoded = Base64 . decode64 ( payload )
74+
75+ zstream = Zlib ::Inflate . new ( -Zlib ::MAX_WBITS )
76+ inflated = zstream . inflate ( decoded )
77+ zstream . finish
78+ zstream . close
79+
80+ assert_match /<samlp:AuthnRequest[^<]* ProtocolBinding='urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'/ , inflated
81+ end
82+
6683 should "accept extra parameters" do
6784 settings = OneLogin ::RubySaml ::Settings . new
6885 settings . idp_sso_target_url = "http://example.com"
You can’t perform that action at this time.
0 commit comments