Skip to content

Commit 9c10696

Browse files
author
Peter Karman
committed
Add note about authn_context as Array, tweek test values
1 parent 7bbef08 commit 9c10696

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ def saml_settings
175175
176176
# Optional for most SAML IdPs
177177
settings.authn_context = "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"
178+
# or as an array
179+
settings.authn_context = [
180+
"urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport",
181+
"urn:oasis:names:tc:SAML:2.0:ac:classes:Password"
182+
]
178183
179184
# Optional bindings (defaults to Redirect for logout POST for acs)
180185
settings.assertion_consumer_service_binding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"

test/request_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ class RequestTest < Minitest::Test
153153
end
154154

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

162162
it "create the saml:AuthnContextClassRef with comparison exact" do

0 commit comments

Comments
 (0)