Class: Onelogin::Saml::SloLogoutrequest
- Inherits:
-
SamlMessage
- Object
- SamlMessage
- Onelogin::Saml::SloLogoutrequest
- Defined in:
- lib/onelogin/ruby-samlnechotech/slo_logoutrequest.rb
Constant Summary
Constants inherited from SamlMessage
Onelogin::Saml::SamlMessage::ASSERTION, Onelogin::Saml::SamlMessage::PROTOCOL
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(request, options = {}) ⇒ SloLogoutrequest
constructor
A new instance of SloLogoutrequest.
- #is_valid? ⇒ Boolean
- #issuer ⇒ Object
-
#name_id ⇒ Object
The value of the user identifier as designated by the initialization request response.
- #validate! ⇒ Object
Methods inherited from SamlMessage
#valid_saml?, #validation_error
Constructor Details
#initialize(request, options = {}) ⇒ SloLogoutrequest
Returns a new instance of SloLogoutrequest.
13 14 15 16 17 18 |
# File 'lib/onelogin/ruby-samlnechotech/slo_logoutrequest.rb', line 13 def initialize(request, = {}) raise ArgumentError.new("Request cannot be nil") if request.nil? @options = @request = decode_raw_saml(request) @document = REXML::Document.new(@request) end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
11 12 13 |
# File 'lib/onelogin/ruby-samlnechotech/slo_logoutrequest.rb', line 11 def document @document end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/onelogin/ruby-samlnechotech/slo_logoutrequest.rb', line 9 def @options end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
10 11 12 |
# File 'lib/onelogin/ruby-samlnechotech/slo_logoutrequest.rb', line 10 def request @request end |
Instance Method Details
#id ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/onelogin/ruby-samlnechotech/slo_logoutrequest.rb', line 36 def id return @id if @id element = REXML::XPath.first(document, "/p:LogoutRequest", { "p" => PROTOCOL} ) return nil if element.nil? return element.attributes["ID"] end |
#is_valid? ⇒ Boolean
20 21 22 |
# File 'lib/onelogin/ruby-samlnechotech/slo_logoutrequest.rb', line 20 def is_valid? validate end |
#issuer ⇒ Object
44 45 46 47 48 49 |
# File 'lib/onelogin/ruby-samlnechotech/slo_logoutrequest.rb', line 44 def issuer @issuer ||= begin node = REXML::XPath.first(document, "/p:LogoutRequest/a:Issuer", { "p" => PROTOCOL, "a" => ASSERTION }) node.nil? ? nil : node.text end end |
#name_id ⇒ Object
The value of the user identifier as designated by the initialization request response
29 30 31 32 33 34 |
# File 'lib/onelogin/ruby-samlnechotech/slo_logoutrequest.rb', line 29 def name_id @name_id ||= begin node = REXML::XPath.first(document, "/p:LogoutRequest/a:NameID", { "p" => PROTOCOL, "a" => ASSERTION }) node.nil? ? nil : node.text end end |
#validate! ⇒ Object
24 25 26 |
# File 'lib/onelogin/ruby-samlnechotech/slo_logoutrequest.rb', line 24 def validate! validate(false) end |