@@ -36,7 +36,7 @@ def create(settings, params = {})
3636 def create_authentication_xml_doc ( settings )
3737 uuid = "_" + UUID . new . generate
3838 time = Time . now . utc . strftime ( "%Y-%m-%dT%H:%M:%SZ" )
39- # Create AuthnRequest root element using REXML
39+ # Create AuthnRequest root element using REXML
4040 request_doc = REXML ::Document . new
4141
4242 root = request_doc . add_element "samlp:AuthnRequest" , { "xmlns:samlp" => "urn:oasis:names:tc:SAML:2.0:protocol" }
@@ -45,6 +45,7 @@ def create_authentication_xml_doc(settings)
4545 root . attributes [ 'Version' ] = "2.0"
4646 root . attributes [ 'Destination' ] = settings . idp_sso_target_url unless settings . idp_sso_target_url . nil?
4747 root . attributes [ 'IsPassive' ] = settings . passive unless settings . passive . nil?
48+ root . attributes [ 'ProtocolBinding' ] = settings . protocol_binding unless settings . protocol_binding . nil?
4849
4950 # Conditionally defined elements based on settings
5051 if settings . assertion_consumer_service_url != nil
@@ -55,7 +56,7 @@ def create_authentication_xml_doc(settings)
5556 issuer . text = settings . issuer
5657 end
5758 if settings . name_identifier_format != nil
58- root . add_element "samlp:NameIDPolicy" , {
59+ root . add_element "samlp:NameIDPolicy" , {
5960 "xmlns:samlp" => "urn:oasis:names:tc:SAML:2.0:protocol" ,
6061 # Might want to make AllowCreate a setting?
6162 "AllowCreate" => "true" ,
@@ -64,14 +65,14 @@ def create_authentication_xml_doc(settings)
6465 end
6566
6667 # BUG fix here -- if an authn_context is defined, add the tags with an "exact"
67- # match required for authentication to succeed. If this is not defined,
68+ # match required for authentication to succeed. If this is not defined,
6869 # the IdP will choose default rules for authentication. (Shibboleth IdP)
6970 if settings . authn_context != nil
70- requested_context = root . add_element "samlp:RequestedAuthnContext" , {
71+ requested_context = root . add_element "samlp:RequestedAuthnContext" , {
7172 "xmlns:samlp" => "urn:oasis:names:tc:SAML:2.0:protocol" ,
7273 "Comparison" => "exact" ,
7374 }
74- class_ref = requested_context . add_element "saml:AuthnContextClassRef" , {
75+ class_ref = requested_context . add_element "saml:AuthnContextClassRef" , {
7576 "xmlns:saml" => "urn:oasis:names:tc:SAML:2.0:assertion" ,
7677 }
7778 class_ref . text = settings . authn_context
0 commit comments