Coldfusion,oauth_signature无效 [英] Coldfusion, The oauth_signature is invalid

查看:88
本文介绍了Coldfusion,oauth_signature无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Coldfusion 9从Ning Network获取凭据,因此首先这是测试api的curl语法:

I'm trying to obtain credentials from ning network using Coldfusion 9, so first this is the curl syntax to test the api :

curl -k https://external.ningapis.com/xn/rest/mbdevsite/1.0/Token?xn_pretty=true -u devshare@megabase.tn:mbdev2011 -d "oauth_signature_method=PLAINTEXT&
oauth_consumer_key=741ab68b-63fb-4949-891c-9e88f5143034&oauth_signature=36da2ea8
-10fb-48cc-aaa4-c17c551c6b87%26"

并返回:

{
  "success" : true,
  "entry" : {
    "author" : "1o0butfek0b3p",
    "oauthConsumerKey" : "741ab68b-63fb-4949-891c-9e88f5143034",
    "oauthToken" : "46f1e137-549a-4d9d-ae05-62782debfd3d",
    "oauthTokenSecret" : "9f778ab5-db8e-4f3e-b17f-61d249b91f0a"
  },
  "resources" : {
  }

然后我将其翻译为Coldfusion:

then i translated it to coldfusion like this :

<cfhttp  
        method="post"  
        url="https://external.ningapis.com/xn/rest/mbdevsite/1.0/Token"
        username="devshare@megabase.tn"
        password="mbdev2011"> 
    <cfhttpparam type="header" name="content-type" value="application/x-www-form-urlencoded">
    <cfhttpparam name="oauth_signature_method" type="FormField" value="PLAINTEXT"/> 
    <cfhttpparam name="oauth_consumer_key" type="FormField" value="741ab68b-63fb-4949-891c-9e88f5143034"/>
    <cfhttpparam name="oauth_signature" type="FormField" value="36da2ea8-10fb-48cc-aaa4-c17c551c6b87%26"/>  
</cfhttp> 


<cfoutput> 
    #cfhttp.fileContent#
</cfoutput> 

,响应始终为:

{"success":false,"reason":"The oauth_signature is invalid. That is, it doesn't match the signature computed by the Service Provider.","status":401,"code":1,"subcode":12,"trace":"3d874587-072b-4877-b27e-b84ee2e2b537"} 

有人知道这个错误可能是什么吗?

does somebody have idea about what could be this error ??

URL和登录信息对于想要通过测试提供帮助的人是真实的

url and login info are real for who wants to help by testing

谢谢。.

推荐答案

不要透露您的用户名&公共论坛上的密码。最好您更改此用户名&此问题完成后输入密码:)

Don't disclose your username & password in public forums. Better you change this user name & password after this issue completion :)

您的oauth_signature是36da2ea8-10fb-48cc-aaa4-c17c551c6b87 & 36da2ea8-10fb-48cc-aaa4-c17c551c6b87 %26

Your oauth_signature is 36da2ea8-10fb-48cc-aaa4-c17c551c6b87& not "36da2ea8-10fb-48cc-aaa4-c17c551c6b87%26"

我得到了成功的回应;

<cfhttp  
            method="post"  
            url="https://external.ningapis.com/xn/rest/mbdevsite/1.0/Token"
            username="devshare@megabase.tn"
            password="mbdev2011"> 
        <cfhttpparam type="header" name="content-type" value="application/x-www-form-urlencoded">
        <cfhttpparam name="oauth_signature_method" type="FormField" value="PLAINTEXT"/> 
        <cfhttpparam name="oauth_consumer_key" type="FormField" value="741ab68b-63fb-4949-891c-9e88f5143034"/>
        <cfhttpparam name="oauth_signature" type="FormField" value="36da2ea8-10fb-48cc-aaa4-c17c551c6b87&"/>  
    </cfhttp> 

这篇关于Coldfusion,oauth_signature无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆