Skip to content

Commit

Permalink
Add note about authn_context as Array, tweek test values
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Karman committed Jul 28, 2016
1 parent 7bbef08 commit 9c10696
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ def saml_settings
# Optional for most SAML IdPs
settings.authn_context = "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"
# or as an array
settings.authn_context = [
"urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport",
"urn:oasis:names:tc:SAML:2.0:ac:classes:Password"
]
# Optional bindings (defaults to Redirect for logout POST for acs)
settings.assertion_consumer_service_binding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Expand Down
6 changes: 3 additions & 3 deletions test/request_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ class RequestTest < Minitest::Test
end

it "create multiple saml:AuthnContextClassRef elements correctly" do
settings.authn_context = ['foo', 'bar']
settings.authn_context = ['secure/name/password/uri', 'secure/email/password/uri']
auth_doc = OneLogin::RubySaml::Authrequest.new.create_authentication_xml_doc(settings)
assert_match /<saml:AuthnContextClassRef>foo<\/saml:AuthnContextClassRef>/, auth_doc.to_s
assert_match /<saml:AuthnContextClassRef>bar<\/saml:AuthnContextClassRef>/, auth_doc.to_s
assert_match /<saml:AuthnContextClassRef>secure\/name\/password\/uri<\/saml:AuthnContextClassRef>/, auth_doc.to_s
assert_match /<saml:AuthnContextClassRef>secure\/email\/password\/uri<\/saml:AuthnContextClassRef>/, auth_doc.to_s
end

it "create the saml:AuthnContextClassRef with comparison exact" do
Expand Down

0 comments on commit 9c10696

Please sign in to comment.