使用Java中的Scribe-1.3.1.jar从Magento检索访问令牌和访问令牌密钥,对于第三方集成,我能够获得Access密钥,但在输入代码后,它会给出以下错误 .
Error is:
1.0 Magento的OAuth工作流程
获取请求令牌...获取请求令牌从设置oauth_callback到oob生成签名...基本字符串是:POST&http%3A%2F%2F192.168.1.22%2Fmagento%2Foauth%2Finitiate&oauth_callback%3Doob%26oauth_consumer_key%3D900bf8e5bd9634637c6a037d8d051209%26oauth_nonce% 3D2723540211%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1406010098%26oauth_version%3D1.0签名是:gMqc93kp2yX91xuwViBNa / ZH5rI =附加额外的OAuth参数:{oauth_callback - > oob,oauth_signature - > gMqc93kp2yX91xuwViBNa / ZH5rI =,oauth_version - > 1.0,oauth_nonce - > 2723540211,oauth_signature_method - > HMAC-SHA1,oauth_consumer_key - > 900bf8e5bd9634637c6a037d8d051209,oauth_timestamp - 使用HTTP头签名发送的请求......响应状态代码> 1406010098}:200响应主体:组oauth_token = cb72f3a6fa004e4f0cf10d3e7584f4fb&oauth_token_secret = 0dbea97335e036747965a1268f51590b&oauth_callback_confirmed =真得请求令牌!
获取授权URL ...获取授权URL!现在去认证Main:http://www.samplewebsite.com / magento / ROOT / admin / oauth_authorize?oauth_token = cb72f3a6fa004e4f0cf10d3e7584f4fb并在此处粘贴授权码
0dbea97335e036747965a1268f51590b
交换访问令牌的请求令牌...从http://www.samplewebsite.com / magento / oauth /令牌设置令牌获取访问令牌:令牌[cb72f3a6fa004e4f0cf10d3e7584f4fb,0dbea97335e036747965a1268f51590b]并且验证者:org.scribe.model.Verifier@7f4a6c40生成签名...基底线是:POST&HTTP%3A%2F%2F192.168.1.22%2Fmagento%2Foauth%2Ftoken&oauth_consumer_key%3D900bf8e5bd9634637c6a037d8d051209%26oauth_nonce%3D1510697252%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1406010111%26oauth_token%3Dcb72f3a6fa004e4f0cf10d3e7584f4fb%26oauth_verifier%3D0dbea97335e036747965a1268f51590b%26oauth_version%3D1 . 0签名是:Fjjimu7RBDnD Wj5SP1gfv1LKo =所附额外的OAuth参数:{oauth_signature - > Fjjimu7RBDnD Wj5SP1gfv1LKo =,oauth_version - > 1.0,oauth_nonce - > 1510697252,oauth_signature_method - > HMAC-SHA1,oauth_consumer_key - > 900bf8e5bd9634637c6a037d8d051209,组oauth_token - > cb72f3a6fa004e4f0cf10d3e7584f4fb,oauth_verifier - > 0dbea97335e036747965a1268f5159 0b,oauth_timestamp - > 1406010111}使用Http Header签名
Exception in thread "main" org.scribe.exceptions.OAuthException: Response body is incorrect. Can't extract token and secret from this: 'oauth_problem=verifier_invalid' at org.scribe.extractors.TokenExtractorImpl.extract(TokenExtractorImpl.java:41) at org.scribe.extractors.TokenExtractorImpl.extract(TokenExtractorImpl.java:27) at org.scribe.oauth.OAuth10aServiceImpl.getAccessToken(OAuth10aServiceImpl.java:82) at auth.main(auth.java:61)
在这种情况下,有人可以帮助我......
1 回答
是的,我有同样的问题,最后解决这个问题 . 在控制器中,您必须将authorize admin url'/ admin / oAuth_authorize'更改为'/ admin / oauth_authorize' . 它区分大小写 .