Class: OmniAuth::Strategies::FacebookSignup::ServiceTicketValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/omniauth/strategies/facebook_signup/service_ticket_validator.rb

Constant Summary collapse

VALIDATION_REQUEST_HEADERS =
{ 'Accept' => '*/*' }

Instance Method Summary collapse

Constructor Details

#initialize(configuration, return_to_url, ticket) ⇒ ServiceTicketValidator

Build a validator from a configuration, a return_to URL, and a ticket.

Parameters:

  • configuration (OmniAuth::Strategies::CAS::Configuration)

    the CAS configuration

  • return_to_url (String)

    the URL of this CAS client service

  • ticket (String)

    the service ticket to validate



16
17
18
# File 'lib/omniauth/strategies/facebook_signup/service_ticket_validator.rb', line 16

def initialize(configuration, return_to_url, ticket)
  @uri = URI.parse(configuration.service_validate_url(return_to_url, ticket))
end

Instance Method Details

#user_infoHash?

Request validation of the ticket from the CAS server’s serviceValidate (CAS 2.0) function.

Swallows all XML parsing errors (and returns nil in those cases).

Returns:

  • (Hash, nil)

    a user information hash if the response is valid; nil otherwise.

Raises:

  • any connection errors encountered.



28
29
30
# File 'lib/omniauth/strategies/facebook_signup/service_ticket_validator.rb', line 28

def 
  (find_authentication_success(get_service_response_body))
end