Class: OmniAuth::Strategies::SageImpact

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

Constant Summary collapse

DEFAULT_RESPONSE_TYPE =
'code'
DEFAULT_GRANT =
'authorization_code'
INFO_URL =
'https://app.sageaccountantscloud.com/api/v1/me'.freeze

Instance Method Summary collapse

Instance Method Details

#authorize_paramsOmniAuth::Strategy::Options

The OAuth2 client authorization parameters.

Returns:

  • (OmniAuth::Strategy::Options)


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

def authorize_params
  super.tap do |params|
    params[:response_type] ||= DEFAULT_RESPONSE_TYPE
    params[:client_id] = client.id
  end
end

#raw_infoHash

Unfiltered data about the authenticating user.

Returns:

  • (Hash)


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

def raw_info
  @raw_info ||= access_token.get(INFO_URL).parsed || {}
end

#token_paramsOmniAuth::Strategy::Options

The OAuth2 client authentication parameters.

Returns:

  • (OmniAuth::Strategy::Options)


52
53
54
55
56
57
58
# File 'lib/omniauth/strategies/sage_impact.rb', line 52

def token_params
  super.tap do |params|
    params[:grant_type] ||= DEFAULT_GRANT
    params[:client_id] = client.id
    params[:client_secret] = client.secret
  end
end