简体   繁体   中英

Invalid OAuth tokens

I am using rforce gem and oauth2 login system for my SFDC app.

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

What you are using here is Oauth1. In Oauth 2 there is only access_token and refresh_token. There is no access_secret any more.

I think this article will help you:

http://wiki.developerforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM