Commit 8ffa0ff
Changed files (2)
lib
saml
kit
builders
spec
saml
kit
builders
lib/saml/kit/builders/assertion.rb
@@ -69,7 +69,7 @@ module Saml
end
def name_id_options
- name_id_format.blank? ? {} : { Format: name_id_format }
+ { Format: name_id_format || Saml::Kit::Namespaces::UNSPECIFIED_NAMEID }
end
end
end
spec/saml/kit/builders/response_spec.rb
@@ -179,7 +179,7 @@ RSpec.describe Saml::Kit::Builders::Response do
authnrequest = Saml::Kit::AuthenticationRequest.new(xml)
user = User.new(name_id: FFaker::Internet.email)
result = Saml::Kit::Response.build(user, authnrequest)
- expect(result.assertion.name_id_format).to be_nil
+ expect(result.assertion.name_id_format).to eql(Saml::Kit::Namespaces::UNSPECIFIED_NAMEID)
end
end