Commit 9198e2c

mo <mo.khan@gmail.com>
2018-01-04 01:51:19
parse assertion issuer.
1 parent 81d75c0
Changed files (2)
lib
spec
saml
lib/saml/kit/assertion.rb
@@ -14,6 +14,10 @@ module Saml
         @configuration = configuration
       end
 
+      def issuer
+        assertion.fetch('Issuer')
+      end
+
       def name_id
         assertion.fetch('Subject', {}).fetch('NameID', nil)
       end
spec/saml/builders/response_spec.rb
@@ -28,6 +28,13 @@ RSpec.describe Saml::Kit::Builders::Response do
       result = subject.build
       expect(result).to be_valid
     end
+
+    it 'includes the issuer' do
+      subject.encrypt = false
+      result = subject.build
+      expect(result.issuer).to eql(issuer)
+      expect(result.assertion.issuer).to eql(issuer)
+    end
   end
 
   describe "#to_xml" do