class OmniAuth::Strategies::WIND::ServiceTicketValidator
Constants
- NS
Public Instance Methods
find_authentication_success(body)
click to toggle source
# File lib/omni_auth/strategies/wind/service_ticket_validator.rb, line 33 def find_authentication_success(body) return nil if body.nil? || body == '' begin doc = Nokogiri::XML(body) begin doc.xpath('/wind:serviceResponse/wind:authenticationSuccess', NS) rescue Nokogiri::XML::XPath::SyntaxError doc.xpath('/serviceResponse/authenticationSuccess') end rescue Nokogiri::XML::XPath::SyntaxError nil end end
parse_user_info(node)
click to toggle source
# File lib/omni_auth/strategies/wind/service_ticket_validator.rb, line 10 def parse_user_info(node) return nil if node.nil? {}.tap do |hash| node.children.each do |e| node_name = e.name.sub(/^wind:/, '') unless e.kind_of?(Nokogiri::XML::Text) || node_name == 'proxies' # There are no child elements if e.element_children.count == 0 hash[node_name] = e.content elsif e.element_children.count # WIND style affiliations if node_name == 'affiliations' hash.merge!(affiliations: e.xpath('wind:affil',NS).collect {|x| x.text}) else hash[node_name] = [] if hash[node_name].nil? hash[node_name].push(parse_user_info(e)) end end end end end end