使用 OAuth 和 Delicious.com API 时出现 Signature_Invalid 错误

发布于 2024-09-25 16:03:39 字数 1218 浏览 0 评论 0原文

我在尝试通过 OAuth 连接到 Daniel.com 时收到 signature_invalid 错误。

<cfset oUrl = "https://api.login.yahoo.com/oauth/v2/get_request_token"/>
<cfset oauth_nonce  = "?oauth_nonce="&randrange(45678,99999)/>
<cfset oauth_timestamp = "&oauth_timestamp=122253373"/>
<cfset oauth_consumer_key = "&oauth_consumer_key="&URLEncodedFormat('dj0yJrvVRvrvrvRVRvvRVervNVFEyTlRFeU5qTTrverVERVERVervervRT4r34r34fgjj--')/>
<cfset oauth_signature_method = "&oauth_signature_method=plaintext"/>
<cfset oauth_signature = "&oauth_signature="&URLEncodedFormat('f28revcevERVrv4f3vVrfr1hgvcWJc112bb0f74Tu')/>
<cfset oauth_version = "&oauth_version=1.0"/>
<cfset xoauth_lang_pref = "&xoauth_lang_pref=en-us"/>
<cfset oauth_callback = "&oauth_callback=http://www.example.com/del/t1.cfm"/>

<cfset my1 = oUrl&oauth_nonce&oauth_timestamp&oauth_consumer_key&oauth_signature_method&oauth_signature&oauth_version&xoauth_lang_pref&oauth_callback/>

我做错了什么?为了进行验证,我使用消费者密钥作为我的 oauth_consumer_key 并使用消费者密钥作为我的 oauth_signature

(这些不是我的实际密钥,我修改了它们。)

I'm getting a signature_invalid error when trying to connect via OAuth to delicious.com.

<cfset oUrl = "https://api.login.yahoo.com/oauth/v2/get_request_token"/>
<cfset oauth_nonce  = "?oauth_nonce="&randrange(45678,99999)/>
<cfset oauth_timestamp = "&oauth_timestamp=122253373"/>
<cfset oauth_consumer_key = "&oauth_consumer_key="&URLEncodedFormat('dj0yJrvVRvrvrvRVRvvRVervNVFEyTlRFeU5qTTrverVERVERVervervRT4r34r34fgjj--')/>
<cfset oauth_signature_method = "&oauth_signature_method=plaintext"/>
<cfset oauth_signature = "&oauth_signature="&URLEncodedFormat('f28revcevERVrv4f3vVrfr1hgvcWJc112bb0f74Tu')/>
<cfset oauth_version = "&oauth_version=1.0"/>
<cfset xoauth_lang_pref = "&xoauth_lang_pref=en-us"/>
<cfset oauth_callback = "&oauth_callback=http://www.example.com/del/t1.cfm"/>

<cfset my1 = oUrl&oauth_nonce&oauth_timestamp&oauth_consumer_key&oauth_signature_method&oauth_signature&oauth_version&xoauth_lang_pref&oauth_callback/>

What am I doing wrong? To verify, I'm using the Consumer Key as my oauth_consumer_key and Consumer Secret as my oauth_signature.

(These are not my actual keys, I modified them.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赠佳期 2024-10-02 16:03:39

不要重新发明轮子。 CF 已经有一个很好的 OAuth 库: http://oauth.riaforge.org/index.cfm

我可以继续告诉您,您的消费者密钥和秘密与密钥和签名不同。它们用于创建签名,然后将其与消费者密钥一起使用。

获取 OAuth 包,并按照其中的教程/演示进行操作。如果您在线搜索 OAuth 教程,会有一些不错的教程。大多数情况下,它们用于 Twitter 集成,但它们仍然提供了很好的概述。

Don't re-invent the wheel. There is already a good OAuth library out there for CF: http://oauth.riaforge.org/index.cfm

I can go ahead and tell you that your consumer key and secret are not the same as key and signature. They are used to create the signature, which you then use with the consumer key.

Get the OAuth package, and follow through the tutorials/demos there. If you search for OAuth tutorials online, there are several good ones. Mostly, they are for Twitter integration, but they still give a good overview.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文