Skip to content

Commit

Permalink
Merge pull request #1 from stian-fredrikstad/slo-logout-bugfix
Browse files Browse the repository at this point in the history
According to the xsd, the issuer has to be before the status
  • Loading branch information
Stian Fredrikstad committed Jun 30, 2015
2 parents 4fa2ed9 + 517e4ec commit 5571dd5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/onelogin/ruby-saml/slo_logoutresponse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ def create_logout_response_xml_doc(settings, request_id = nil, logout_message =
root.attributes['InResponseTo'] = request_id unless request_id.nil?
root.attributes['Destination'] = settings.idp_slo_target_url unless settings.idp_slo_target_url.nil?

if settings.issuer != nil
issuer = root.add_element "saml:Issuer"
issuer.text = settings.issuer
end

# add success message
status = root.add_element 'samlp:Status'

Expand All @@ -116,11 +121,6 @@ def create_logout_response_xml_doc(settings, request_id = nil, logout_message =
status_message = status.add_element 'samlp:StatusMessage'
status_message.text = logout_message

if settings.issuer != nil
issuer = root.add_element "saml:Issuer"
issuer.text = settings.issuer
end

# embed signature
if settings.security[:logout_responses_signed] && settings.private_key && settings.certificate && settings.security[:embed_sign]
private_key = settings.get_sp_key
Expand Down

0 comments on commit 5571dd5

Please sign in to comment.