Class: Samlurai::LogoutResponse
- Inherits:
-
Object
- Object
- Samlurai::LogoutResponse
- Defined in:
- lib/samlurai/logout_response.rb
Instance Attribute Summary collapse
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#in_response_to ⇒ Object
readonly
Returns the value of attribute in_response_to.
-
#issuer ⇒ Object
readonly
Returns the value of attribute issuer.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
-
#status_message ⇒ Object
readonly
Returns the value of attribute status_message.
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
Instance Method Summary collapse
-
#initialize(response, settings = nil) ⇒ LogoutResponse
constructor
A new instance of LogoutResponse.
- #logger=(val) ⇒ Object
- #process(settings) ⇒ Object
- #success_status? ⇒ Boolean
Constructor Details
#initialize(response, settings = nil) ⇒ LogoutResponse
Returns a new instance of LogoutResponse.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/samlurai/logout_response.rb', line 7 def initialize(response, settings=nil) @response = response @xml = Base64.decode64(@response) zlib = Zlib::Inflate.new(-Zlib::MAX_WBITS) @xml = zlib.inflate(@xml) @document = LibXML::XML::Document.string(@xml) @request_id = @document.find_first("/samlp:LogoutResponse", Samlurai::NAMESPACES)['ID'] rescue nil @issuer = @document.find_first("/samlp:LogoutResponse/saml:Issuer", Samlurai::NAMESPACES).content rescue nil @in_response_to = @document.find_first("/samlp:LogoutResponse", Samlurai::NAMESPACES)['InResponseTo'] rescue nil @destination = @document.find_first("/samlp:LogoutResponse", Samlurai::NAMESPACES)['Destination'] rescue nil @status_code = @document.find_first("/samlp:LogoutResponse/samlp:Status/samlp:StatusCode", Samlurai::NAMESPACES)['Value'] rescue nil @status_message = @document.find_first("/samlp:LogoutResponse/samlp:Status/samlp:StatusMessage", Samlurai::NAMESPACES).content rescue nil process(settings) if settings end |
Instance Attribute Details
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
6 7 8 |
# File 'lib/samlurai/logout_response.rb', line 6 def destination @destination end |
#document ⇒ Object (readonly)
Returns the value of attribute document.
4 5 6 |
# File 'lib/samlurai/logout_response.rb', line 4 def document @document end |
#in_response_to ⇒ Object (readonly)
Returns the value of attribute in_response_to.
6 7 8 |
# File 'lib/samlurai/logout_response.rb', line 6 def in_response_to @in_response_to end |
#issuer ⇒ Object (readonly)
Returns the value of attribute issuer.
5 6 7 |
# File 'lib/samlurai/logout_response.rb', line 5 def issuer @issuer end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
6 7 8 |
# File 'lib/samlurai/logout_response.rb', line 6 def request_id @request_id end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/samlurai/logout_response.rb', line 4 def response @response end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
4 5 6 |
# File 'lib/samlurai/logout_response.rb', line 4 def settings @settings end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
5 6 7 |
# File 'lib/samlurai/logout_response.rb', line 5 def status_code @status_code end |
#status_message ⇒ Object (readonly)
Returns the value of attribute status_message.
5 6 7 |
# File 'lib/samlurai/logout_response.rb', line 5 def @status_message end |
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
4 5 6 |
# File 'lib/samlurai/logout_response.rb', line 4 def xml @xml end |
Instance Method Details
#logger=(val) ⇒ Object
30 31 32 |
# File 'lib/samlurai/logout_response.rb', line 30 def logger=(val) @logger = val end |
#process(settings) ⇒ Object
25 26 27 28 |
# File 'lib/samlurai/logout_response.rb', line 25 def process(settings) @settings = settings return unless @response end |
#success_status? ⇒ Boolean
34 35 36 |
# File 'lib/samlurai/logout_response.rb', line 34 def success_status? @status_code == Samlurai::StatusCodes::SUCCESS_URI end |