Class: SAML2::AuthnRequest
Instance Attribute Summary collapse
Attributes inherited from Message
#destination, #id, #issue_instant, #issuer
Attributes inherited from Base
#xml
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Message
#from_xml, from_xml, inherited, #initialize, parse
Methods inherited from Base
from_xml, #from_xml, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml
Constructor Details
This class inherits a constructor from SAML2::Message
Instance Attribute Details
#assertion_consumer_service ⇒ Object
Returns the value of attribute assertion_consumer_service.
70
71
72
|
# File 'lib/saml2/authn_request.rb', line 70
def assertion_consumer_service
@assertion_consumer_service
end
|
#attribute_consuming_service ⇒ Object
Returns the value of attribute attribute_consuming_service.
70
71
72
|
# File 'lib/saml2/authn_request.rb', line 70
def attribute_consuming_service
@attribute_consuming_service
end
|
Class Method Details
.decode(authnrequest) ⇒ Object
deprecated; takes just the SAMLRequest parameter’s value
Instance Method Details
#assertion_consumer_service_index ⇒ Object
76
77
78
|
# File 'lib/saml2/authn_request.rb', line 76
def assertion_consumer_service_index
xml['AssertionConsumerServiceIndex'] && xml['AssertionConsumerServiceIndex'].to_i
end
|
#assertion_consumer_service_url ⇒ Object
72
73
74
|
# File 'lib/saml2/authn_request.rb', line 72
def assertion_consumer_service_url
xml['AssertionConsumerServiceURL']
end
|
#attribute_consuming_service_index ⇒ Object
80
81
82
|
# File 'lib/saml2/authn_request.rb', line 80
def attribute_consuming_service_index
xml['AttributeConsumerServiceIndex'] && xml['AttributeConsumerServiceIndex'].to_i
end
|
#force_authn? ⇒ Boolean
84
85
86
|
# File 'lib/saml2/authn_request.rb', line 84
def force_authn?
xml['ForceAuthn']
end
|
#name_id_policy ⇒ Object
66
67
68
|
# File 'lib/saml2/authn_request.rb', line 66
def name_id_policy
@name_id_policy ||= NameID::Policy.from_xml(xml.at_xpath('samlp:NameIDPolicy', Namespaces::ALL))
end
|
#passive? ⇒ Boolean
88
89
90
|
# File 'lib/saml2/authn_request.rb', line 88
def passive?
xml['IsPassive']
end
|
#protocol_binding ⇒ Object
92
93
94
|
# File 'lib/saml2/authn_request.rb', line 92
def protocol_binding
xml['ProtocolBinding']
end
|
#resolve(service_provider) ⇒ Object
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/saml2/authn_request.rb', line 50
def resolve(service_provider)
if assertion_consumer_service_url
@assertion_consumer_service = service_provider.assertion_consumer_services.find { |acs| acs.location == assertion_consumer_service_url }
else
@assertion_consumer_service = service_provider.assertion_consumer_services.resolve(assertion_consumer_service_index)
end
@attribute_consuming_service = service_provider.attribute_consuming_services.resolve(attribute_consuming_service_index)
return false unless @assertion_consumer_service
return false if attribute_consuming_service_index && !@attribute_consuming_service
true
end
|
#subject ⇒ Object
96
97
98
|
# File 'lib/saml2/authn_request.rb', line 96
def subject
@subject ||= Subject.from_xml(xml.at_xpath('saml:Subject', Namespaces::ALL))
end
|
#valid_interoperable_profile? ⇒ Boolean
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/saml2/authn_request.rb', line 39
def valid_interoperable_profile?
return false unless valid_web_browser_sso_profile?
return false unless assertion_consumer_service_url
return false if protocol_binding && protocol_binding != Endpoint::Bindings::HTTP_POST
return false if subject
true
end
|
#valid_schema? ⇒ Boolean
24
25
26
27
28
29
30
|
# File 'lib/saml2/authn_request.rb', line 24
def valid_schema?
return false unless super
return false unless xml.at_xpath('/samlp:AuthnRequest', Namespaces::ALL)
true
end
|
#valid_web_browser_sso_profile? ⇒ Boolean
32
33
34
35
36
37
|
# File 'lib/saml2/authn_request.rb', line 32
def valid_web_browser_sso_profile?
return false unless issuer
return false if issuer.format && issuer.format != NameID::Format::ENTITY
true
end
|