Commit 9cc1812
Changed files (2)
lib
saml
kit
spec
saml
kit
lib/saml/kit/respondable.rb
@@ -21,7 +21,7 @@ module Saml
# Returns the /InResponseTo attribute.
def in_response_to
- to_h.fetch(name, {}).fetch('InResponseTo', nil)
+ at_xpath('./*/@InResponseTo').try(:value)
end
# Returns true if the Status code is #{Saml::Kit::Namespaces::SUCCESS}
spec/saml/kit/response_spec.rb
@@ -5,6 +5,7 @@ RSpec.describe Saml::Kit::Response do
let(:user) { User.new(attributes: { id: SecureRandom.uuid }) }
specify { expect(subject.status_code).to eql(Saml::Kit::Namespaces::SUCCESS) }
+ specify { expect(subject.in_response_to).to eql(request.id) }
describe '#valid?' do
subject { described_class.build(user, request, configuration: configuration) }