Class: OmniAuth::Strategies::Twitcasting

Inherits:
OAuth2
  • Object
show all
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

Instance Method Details

#authorize_paramsObject



60
61
62
63
64
65
66
# File 'lib/omniauth/strategies/twitcasting.rb', line 60

def authorize_params
  super.tap do |params|
    AUTHENTICATION_PARAMETERS.each do |v|
      params[v.to_sym] = request.params[v] if request.params[v]
    end
  end
end

#callback_phaseObject

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_urlObject

Over-ride callback_url definition to maintain compatability with omniauth-oauth2 >= 1.4.0

See: github.com/intridea/omniauth-oauth2/issues/81



44
45
46
# File 'lib/omniauth/strategies/twitcasting.rb', line 44

def callback_url
  full_host + script_name + callback_path
end

#raw_infoObject



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_phaseObject

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