Class: OmniAuth::Strategies::Vonage

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/vonage.rb

Instance Method Summary collapse

Instance Method Details

#callback_urlObject



41
42
43
# File 'lib/omniauth/strategies/vonage.rb', line 41

def callback_url
  options[:redirect_uri] || (full_host + script_name + callback_path)
end

#client_get_token(verifier, redirect_uri) ⇒ Object



50
51
52
# File 'lib/omniauth/strategies/vonage.rb', line 50

def client_get_token(verifier, redirect_uri)
  client.auth_code.get_token(verifier, get_token_options(redirect_uri), get_token_params)
end

#get_access_token(request) ⇒ Object



45
46
47
48
# File 'lib/omniauth/strategies/vonage.rb', line 45

def get_access_token(request)
  verifier = request.params['code']
  client_get_token(verifier, callback_url)
end

#get_token_options(redirect_uri = '') ⇒ Object



58
59
60
# File 'lib/omniauth/strategies/vonage.rb', line 58

def get_token_options(redirect_uri = '')
  { redirect_uri: redirect_uri }.merge(token_params.to_hash(symbolize_keys: true))
end

#get_token_paramsObject



54
55
56
# File 'lib/omniauth/strategies/vonage.rb', line 54

def get_token_params
  deep_symbolize(options.auth_token_params || {})
end

#raw_infoObject



37
38
39
# File 'lib/omniauth/strategies/vonage.rb', line 37

def raw_info
  @raw_info ||= access_token.get('/oauth2/userinfo').parsed
end