Class: OmniAuth::Strategies::FacebookSignup::Configuration
- Inherits:
-
Object
- Object
- OmniAuth::Strategies::FacebookSignup::Configuration
- Defined in:
- lib/omniauth/strategies/facebook_signup/configuration.rb
Constant Summary collapse
- DEFAULT_LOGIN_URL =
"%s/auth/facebook/prerequest"
- DEFAULT_SERVICE_VALIDATE_URL =
"%s/serviceValidate"
Instance Method Summary collapse
-
#initialize(params) ⇒ Configuration
constructor
A new instance of Configuration.
-
#login_url(service) ⇒ String
Build a CAS login URL from
service
. -
#service_validate_url(service, ticket) ⇒ String
Build a service-validation URL from
service
andticket
.
Constructor Details
#initialize(params) ⇒ Configuration
Returns a new instance of Configuration.
21 22 23 |
# File 'lib/omniauth/strategies/facebook_signup/configuration.rb', line 21 def initialize(params) parse_params params end |
Instance Method Details
#login_url(service) ⇒ String
Build a CAS login URL from service
.
30 31 32 |
# File 'lib/omniauth/strategies/facebook_signup/configuration.rb', line 30 def login_url(service) append_service @login_url, service end |
#service_validate_url(service, ticket) ⇒ String
Build a service-validation URL from service
and ticket
. If service
has a ticket param, first remove it. URL-encode service
and add it and the ticket
as paraemters to the CAS serviceValidate URL.
43 44 45 46 47 |
# File 'lib/omniauth/strategies/facebook_signup/configuration.rb', line 43 def service_validate_url(service, ticket) service = service.sub(/[?&]ticket=[^?&]+/, '') url = append_service(@service_validate_url, service) url << '&ticket=' << Rack::Utils.escape(ticket) end |