rforce icon indicating copy to clipboard operation
rforce copied to clipboard

Invalid OAuth tokens

Open rubydog opened this issue 14 years ago • 1 comments

I am trying to login through Oauth2 but I get Invalid OAuth tokens error. Here is my code

access_token = oauth_client.web_server.get_access_token(params[:code], :redirect_uri => oauth_redirect_uri, :grant_type => 'authorization_code')

access_token is an OAuth2::AccessToken object

oauth = { :consumer_key => '3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3vxxxxxxxxxxxxxxxN', :consumer_secret => '7xxxxxxxxxxx291xxxxxxx1', :access_token => access_token.token, :access_secret => '7xxxxxxxxxxx291xxxxxxx1', :login_url => 'https://login.salesforce.com/services/OAuth/u/20.0' }

I think consumer_secret and access_secret are same. If not, then what is access_secret and where could I find it? I am using oauth2 -v 0.4.1 and rforce -v 0.8.1

rubydog avatar Feb 21 '12 11:02 rubydog

consumer_secret is assigned by SalesForce. access_token and access_secret are generated by Ruby's OAuth library from the user-entered verification code (issued when the user grants access).

Here's an example of the process:

https://gist.github.com/300175

undees avatar Feb 21 '12 14:02 undees