Class: OmniAuth::Strategies::Forcedotcom
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Forcedotcom
- Defined in:
- lib/Salesforce/oauth2/forcedotcom.rb
Instance Method Summary collapse
- #auth_hash ⇒ Object
- #callback_phase ⇒ Object
-
#initialize(app, client_id = nil, client_secret = nil, options = {}, &block) ⇒ Forcedotcom
constructor
Initialize the middleware.
- #request_phase ⇒ Object
Constructor Details
#initialize(app, client_id = nil, client_secret = nil, options = {}, &block) ⇒ Forcedotcom
Initialize the middleware
14 15 16 17 18 19 20 21 |
# File 'lib/Salesforce/oauth2/forcedotcom.rb', line 14 def initialize(app, client_id = nil, client_secret = nil, = {}, &block) = { :site => "https://login.salesforce.com", :authorize_path => "/services/oauth2/authorize", :access_token_path => "/services/oauth2/token" } super(app, :forcedotcom, client_id, client_secret, , &block) end |
Instance Method Details
#auth_hash ⇒ Object
33 34 35 36 37 |
# File 'lib/Salesforce/oauth2/forcedotcom.rb', line 33 def auth_hash OmniAuth::Utils.deep_merge(super, { 'instance_url' => @access_token['instance_url'] }) end |
#callback_phase ⇒ Object
28 29 30 31 |
# File 'lib/Salesforce/oauth2/forcedotcom.rb', line 28 def callback_phase [:grant_type] ||= 'authorization_code' super end |
#request_phase ⇒ Object
23 24 25 26 |
# File 'lib/Salesforce/oauth2/forcedotcom.rb', line 23 def request_phase [:response_type] ||= 'code' super end |