Class: Restforce::Middleware::Authentication::Password

Inherits:
Restforce::Middleware::Authentication show all
Defined in:
lib/restforce/middleware/authentication/password.rb

Overview

Authentication middleware used if username and password flow is used

Instance Method Summary collapse

Methods inherited from Restforce::Middleware::Authentication

#authenticate!, #call, #connection, #encode_www_form, #error_message

Methods inherited from Restforce::Middleware

#client, #connection, #initialize

Constructor Details

This class inherits a constructor from Restforce::Middleware

Instance Method Details

#paramsObject



4
5
6
7
8
9
10
# File 'lib/restforce/middleware/authentication/password.rb', line 4

def params
  { grant_type: 'password',
    client_id: @options[:client_id],
    client_secret: @options[:client_secret],
    username: @options[:username],
    password: password }
end

#passwordObject



12
13
14
# File 'lib/restforce/middleware/authentication/password.rb', line 12

def password
  "#{@options[:password]}#{@options[:security_token]}"
end