[英]Invalid OAuth tokens
I am using rforce gem and oauth2 login system for my SFDC app. 我正在为我的SFDC应用程序使用rforce gem和oauth2登录系统。
I am trying to login through Oauth2 but I get Invalid OAuth tokens
error. 我正在尝试通过Oauth2登录,但收到
Invalid OAuth tokens
错误。 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 access_token是一个OAuth2 :: AccessToken对象
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. 我认为Consumer_secret和access_secret是相同的。 If not, then what is access_secret and where could I find it?
如果没有,那么什么是access_secret,我在哪里可以找到它? I am using
oauth2 -v 0.4.1
and rforce -v 0.8.1
我正在使用
oauth2 -v 0.4.1
和rforce -v 0.8.1
What you are using here is Oauth1. 您在这里使用的是Oauth1。 In Oauth 2 there is only access_token and refresh_token.
在Oauth 2中,只有access_token和refresh_token。 There is no access_secret any more.
不再有access_secret。
I think this article will help you: 我认为本文将为您提供帮助:
http://wiki.developerforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com http://wiki.developerforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.