Class: OmniAuth::Strategies::Edlink

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

Defined Under Namespace

Classes: AccessToken

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject



35
36
37
38
39
40
# File 'lib/omniauth/strategies/edlink.rb', line 35

def authorize_params
  super.tap do |params|
    params[:scope] = [:email, :profile]
    params[:response_type] = :code
  end
end

#raw_infoObject



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

def raw_info
  @raw_info ||= access_token.get('https://ed.link/api/v2/my/profile').parsed['$data']
end

#request_phaseObject



29
30
31
32
33
# File 'lib/omniauth/strategies/edlink.rb', line 29

def request_phase
  integration_id = request.params['integration_id']
  authorize_path = integration_id.present? ? integration_authorize_path(integration_id) : options.client_options.authorize_url
  redirect client.connection.build_url(URI.join(options.client_options.site, authorize_path), authorize_params)
end