Signature_Invalid error using OAuth with Delicious.com API
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--开发者_如何学Python')/>
<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.)
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.
精彩评论