Class: OmniAuth::Strategies::Twitcasting
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Twitcasting
- Defined in:
- lib/omniauth/strategies/twitcasting.rb
Overview
Authenticate to TwitCasting via OAuth and retrieve basic user information. Usage:
use OmniAuth::Strategies::Twitcasting, 'consumerkey', 'consumersecret'
Constant Summary collapse
- AUTHENTICATION_PARAMETERS =
%w(state)
- BASE_URL =
'https://apiv2.twitcasting.tv'
Instance Method Summary collapse
- #authorize_params ⇒ Object
-
#callback_phase ⇒ Object
Hook used after response with code from provider.
-
#callback_url ⇒ Object
Over-ride callback_url definition to maintain compatability with omniauth-oauth2 >= 1.4.0.
- #raw_info ⇒ Object
-
#request_phase ⇒ Object
Hook useful for appending parameters into the auth url before sending to provider.
Instance Method Details
#authorize_params ⇒ Object
60 61 62 63 64 65 66 |
# File 'lib/omniauth/strategies/twitcasting.rb', line 60 def super.tap do |params| AUTHENTICATION_PARAMETERS.each do |v| params[v.to_sym] = request.params[v] if request.params[v] end end end |
#callback_phase ⇒ Object
Hook used after response with code from provider. Used to prep token request from provider.
56 57 58 |
# File 'lib/omniauth/strategies/twitcasting.rb', line 56 def callback_phase super end |
#callback_url ⇒ Object
Over-ride callback_url definition to maintain compatability with omniauth-oauth2 >= 1.4.0
44 45 46 |
# File 'lib/omniauth/strategies/twitcasting.rb', line 44 def callback_url full_host + script_name + callback_path end |
#raw_info ⇒ Object
36 37 38 |
# File 'lib/omniauth/strategies/twitcasting.rb', line 36 def raw_info @raw_info ||= access_token.get(BASE_URL + '/verify_credentials').parsed end |
#request_phase ⇒ Object
Hook useful for appending parameters into the auth url before sending to provider.
50 51 52 |
# File 'lib/omniauth/strategies/twitcasting.rb', line 50 def request_phase super end |