module FlowAccount::Auth

Public Instance Methods

authorize_url(options={}) click to toggle source
# File lib/flow_account/auth.rb, line 11
def authorize_url(options={})
  options[:scope] ||= scope if !scope.nil? && !scope.empty?

  params = authorization_params.merge(options)
  connection.build_url("token", params).to_s
end
get_access_token(options={}) click to toggle source
# File lib/flow_account/auth.rb, line 3
def get_access_token(options={})
  options[:grant_type] ||= "client_credentials"
  options[:scope] ||= scope if !scope.nil? && !scope.empty?

  params = access_token_params.merge(options)
  post("token", params, raw=false, no_response_wrapper=true)
end

Private Instance Methods

access_token_params() click to toggle source
# File lib/flow_account/auth.rb, line 19
def access_token_params
  {
    client_id: client_id,
    client_secret: client_secret
  }
end
authorization_params() click to toggle source
# File lib/flow_account/auth.rb, line 26
def authorization_params
  {
    client_id: client_id,
    scope: scope
  }
end