Class: OmniAuth::Strategies::Etencent

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

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/omniauth/strategies/etencent.rb', line 16

def authorize_params
  super.tap do |params|
    %w[scope client_options].each do |v|
      if request.params[v]
        params[v.to_sym] = request.params[v]
        # to support omniauth-oauth2's auto csrf protection
        session['omniauth.state'] = params[:state] if v == 'state'
      end
    end
  end
end

#authorizer_infoObject



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

def authorizer_info
  @authorizer_info ||= access_token.to_hash.dig('authorizer_info') || {}
end

#request_phaseObject



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

def request_phase
  session['omniauth.redirect_uri'] = callback_url
  super
end

#scopeObject



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

def scope
  authorizer_info['scope_list']
end