Class: RSAML::Protocol::RequestedAuthnContext
- Inherits:
-
Object
- Object
- RSAML::Protocol::RequestedAuthnContext
- Defined in:
- lib/rsaml/protocol/requested_authn_context.rb
Overview
Specifies the authentication context requirements of authentication statements returned in response to a request or query.
Class Method Summary collapse
-
.comparisons ⇒ Object
List of available comparison values.
Instance Method Summary collapse
-
#authn_context_refs ⇒ Object
Authentication context references, either AuthnContextDeclRef or AuthnContextClassRef.
-
#comparison ⇒ Object
Specifies the comparison method used to evaluate the requested context classes or statements, one of “exact”, “minimum”, “maximum”, or “better”.
-
#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object
Construct an XML fragment representing the requested authn context.
-
#validate ⇒ Object
Validate the structure of the requested authn context.
Class Method Details
.comparisons ⇒ Object
List of available comparison values
7 8 9 |
# File 'lib/rsaml/protocol/requested_authn_context.rb', line 7 def self.comparisons @comparisons ||= ['exact','minimum','maximum','better'] end |
Instance Method Details
#authn_context_refs ⇒ Object
Authentication context references, either AuthnContextDeclRef or AuthnContextClassRef.
12 13 14 |
# File 'lib/rsaml/protocol/requested_authn_context.rb', line 12 def authn_context_refs @authn_context_refs ||= [] end |
#comparison ⇒ Object
Specifies the comparison method used to evaluate the requested context classes or statements, one of “exact”, “minimum”, “maximum”, or “better”. The default is “exact”
18 19 20 |
# File 'lib/rsaml/protocol/requested_authn_context.rb', line 18 def comparison @comparison ||= 'exact' end |
#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object
Construct an XML fragment representing the requested authn context
28 29 30 31 |
# File 'lib/rsaml/protocol/requested_authn_context.rb', line 28 def to_xml(xml=Builder::XmlMarkup.new) attributes = {'Comparison' => comparison} xml.tag!('samlp:RequestedAuthnContext') end |
#validate ⇒ Object
Validate the structure of the requested authn context
23 24 25 |
# File 'lib/rsaml/protocol/requested_authn_context.rb', line 23 def validate raise ValidationError, "Unknown comparison type: #{comparison}" unless RequestedAuthContext.comparisons.include?(comparison) end |