Class: Devise::Strategies::OpenidAuthenticatable
- Inherits:
-
Authenticatable
- Object
- Authenticatable
- Devise::Strategies::OpenidAuthenticatable
- Defined in:
- lib/devise_openid_authenticatable/strategy.rb
Instance Method Summary collapse
- #authenticate! ⇒ Object
-
#store? ⇒ Boolean
CSRF won’t be able to be verified on returning from the OpenID server, so we will bypass that check for this strategy.
- #valid? ⇒ Boolean
Instance Method Details
#authenticate! ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/devise_openid_authenticatable/strategy.rb', line 10 def authenticate! logger.debug("Authenticating with OpenID for mapping #{mapping.to}") if provider_response handle_response! else # Delegate authentication to Rack::OpenID by throwing a 401 opts = { :identifier => identity_url, :return_to => return_url, :trust_root => trust_root, :method => 'post' } opts[:immediate] = true if scoped_params["immediate"] opts[:optional] = mapping.to.openid_optional_fields if mapping.to.respond_to?(:openid_optional_fields) opts[:required] = mapping.to.openid_required_fields if mapping.to.respond_to?(:openid_required_fields) custom! [401, { Rack::OpenID::AUTHENTICATE_HEADER => Rack::OpenID.build_header(opts) }, "Sign in with OpenID"] end end |
#store? ⇒ Boolean
CSRF won’t be able to be verified on returning from the OpenID server, so we will bypass that check for this strategy
26 27 28 |
# File 'lib/devise_openid_authenticatable/strategy.rb', line 26 def store? true end |
#valid? ⇒ Boolean
6 7 8 |
# File 'lib/devise_openid_authenticatable/strategy.rb', line 6 def valid? valid_mapping? && ( provider_response? || identity_param? ) end |