Class: WardenOauthProvider::TokenStrategy
- Inherits:
-
Warden::Strategies::Base
- Object
- Warden::Strategies::Base
- WardenOauthProvider::TokenStrategy
- Defined in:
- lib/warden_oauth_provider/token_strategy.rb
Instance Method Summary collapse
- #authenticate! ⇒ Object
-
#store? ⇒ Boolean
This is just a single check for the token, don’t store any result in the session.
- #valid? ⇒ Boolean
Instance Method Details
#authenticate! ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/warden_oauth_provider/token_strategy.rb', line 8 def authenticate! request_token = WardenOauthProvider::Token::Request.find_by_token(request.params["oauth_token"]) if !request_token or request_token.invalidated? fail! else if request_token.(env['warden'].user) redirect_url = URI.parse(request_token.oob? ? request_token.client_application.callback_url : request_token.callback_url) redirect_url.query ||= "" redirect_url.query += "&" unless redirect_url.query.blank? redirect_url.query += "oauth_token=#{request_token.token}&oauth_verifier=#{request_token.verifier}" env['oauth.redirect_url'] = redirect_url.to_s success!(env['warden'].user) else fail!("Token authorization failed!") end end end |
#store? ⇒ Boolean
This is just a single check for the token, don’t store any result in the session
29 30 31 |
# File 'lib/warden_oauth_provider/token_strategy.rb', line 29 def store? false end |
#valid? ⇒ Boolean
4 5 6 |
# File 'lib/warden_oauth_provider/token_strategy.rb', line 4 def valid? true end |