I'm trying to use Restforce (https://github.com/ejholmes/restforce) to set up integration with my Rails app to SalesForce's API using Oauth 2.0.
Restforce describes the initialization process as follows:
Initialization
Which authentication method you use really depends on your use case. If you're building an application where many users from different orgs are authenticated through oauth and you need to interact with data in their org on their behalf, you should use the OAuth token authentication method.
If you're using the gem to interact with a single org (maybe you're building some salesforce integration internally?) then you should use the username/password authentication method.
OAuth token authentication
client = Restforce.new :oauth_token => 'oauth token', :instance_url => 'instance url'
Although the above will work, you'll probably want to take advantage of the (re)authentication middleware by specifying a refresh token, client id and client secret:
client = Restforce.new :oauth_token => 'oauth token', :refresh_token => 'refresh token', :instance_url => 'instance url', :client_id => 'client_id', :client_secret => 'client_secret'
I have my client_id
and client_secret
from the app that was created in SF, but have no idea what other information I need to be putting into restforce.
Does anyone have any experience with this gem? How do I use it to make the original request token request to SF?