Skip to content

Commit 1c2b0f1

Browse files
authored
Merge pull request SAML-Toolkits#391 from treehouse/better-binding-defaults
Attempt to detect binding for SSO and SLO
2 parents 5aa5d39 + 39935bd commit 1c2b0f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/onelogin/ruby-saml/idp_metadata_parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def single_signon_service_binding(binding_priority = nil)
142142
# @return [String|nil] SingleSignOnService endpoint if exists
143143
#
144144
def single_signon_service_url(options = {})
145-
binding = options[:sso_binding] || "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
145+
binding = options[:sso_binding] || single_signon_service_binding || "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
146146
node = REXML::XPath.first(
147147
document,
148148
"/md:EntityDescriptor/md:IDPSSODescriptor/md:SingleSignOnService[@Binding=\"#{binding}\"]/@Location",
@@ -172,7 +172,7 @@ def single_logout_service_binding(binding_priority = nil)
172172
# @return [String|nil] SingleLogoutService endpoint if exists
173173
#
174174
def single_logout_service_url(options = {})
175-
binding = options[:slo_binding] || "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
175+
binding = options[:slo_binding] || single_logout_service_binding || "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
176176
node = REXML::XPath.first(
177177
document,
178178
"/md:EntityDescriptor/md:IDPSSODescriptor/md:SingleLogoutService[@Binding=\"#{binding}\"]/@Location",

0 commit comments

Comments
 (0)