@@ -467,6 +467,9 @@ Imagine this `saml:AttributeStatement`
467467 < saml:AttributeValue xmlns:xs=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xsi:nil=" true" />
468468 < saml:AttributeValue xmlns:xs=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xsi:nil=" 1" />
469469 < /saml:Attribute>
470+ < saml:Attribute Name=" http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname" >
471+ < saml:AttributeValue> usersName< /saml:AttributeValue>
472+ < /saml:Attribute>
470473 < /saml:AttributeStatement>
471474` ` `
472475
@@ -477,7 +480,8 @@ pp(response.attributes) # is an OneLogin::RubySaml::Attributes object
477480 "another_value"=>["value1", "value2"],
478481 "role"=>["role1", "role2", "role3"],
479482 "attribute_with_nil_value"=>[nil],
480- "attribute_with_nils_and_empty_strings"=>["", "valuePresent", nil, nil]}>
483+ "attribute_with_nils_and_empty_strings"=>["", "valuePresent", nil, nil]
484+ "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname"=>["usersName"]}>
481485
482486# Active single_value_compatibility
483487OneLogin::RubySaml::Attributes.single_value_compatibility = true
@@ -494,6 +498,9 @@ pp(response.attributes.single(:role))
494498pp(response.attributes.multi(:role))
495499# => ["role1", "role2", "role3"]
496500
501+ pp(response.attributes.fetch(:role))
502+ # => "role1"
503+
497504pp(response.attributes[:attribute_with_nil_value])
498505# => nil
499506
@@ -509,6 +516,9 @@ pp(response.attributes.single(:not_exists))
509516pp(response.attributes.multi(:not_exists))
510517# => nil
511518
519+ pp(response.attributes.fetch(/givenname/))
520+ # => "usersName"
521+
512522# Deactive single_value_compatibility
513523OneLogin::RubySaml::Attributes.single_value_compatibility = false
514524
@@ -524,6 +534,9 @@ pp(response.attributes.single(:role))
524534pp(response.attributes.multi(:role))
525535# => ["role1", "role2", "role3"]
526536
537+ pp(response.attributes.fetch(:role))
538+ # => ["role1", "role2", "role3"]
539+
527540pp(response.attributes[:attribute_with_nil_value])
528541# => [nil]
529542
@@ -538,6 +551,9 @@ pp(response.attributes.single(:not_exists))
538551
539552pp(response.attributes.multi(:not_exists))
540553# => nil
554+
555+ pp(response.attributes.fetch(/givenname/))
556+ # => ["usersName"]
541557` ` `
542558
543559The ` saml:AuthnContextClassRef` of the AuthNRequest can be provided by ` settings.authn_context` ; possible values are described at [SAMLAuthnCxt]. The comparison method can be set using ` settings.authn_context_comparison` parameter. Possible values include: ' exact' , ' better' , ' maximum' and ' minimum' (default value is ' exact' ).
0 commit comments