Troubleshooting oauth to status.net?

81 views
Skip to first unread message

Benjamin Reed

unread,
Oct 5, 2012, 2:56:57 PM10/5/12
to jso...@googlegroups.com
I'm attempting to use jsOauth to connect a webapp (which will eventually be a phonegap app) to a status.net server.  I tried first with identi.ca, and then with my own server, and no matter what I do, all I get back is "Invalid Signature" when I attempt to actually pass my verifier key in.  Am I just missing something obvious?  Attached is a somewhat scrubbed version of my code (please excuse the code, it was not as awful before I went through a million iterations trying to make it work... :P).

Note that this version opens a new window, and then polls the window for the pin before returning.  Previously I was using pinless oauth, but that wasn't working so thought I'd try this again.

My console log contains:

oauth_token = undefined auth.js:53
oauth_verifier = undefined auth.js:54
No stored oauth data, starting from scratch. auth.js:65
creating oauth object auth.js:68
passed oauth auth.js:75
Object
auth.js:76
found pin: 194250 auth.js:87
Error: authorization failed: {"text":"Invalid signature","xml":"","requestHeaders":{},"responseHeaders":{"Date":"Fri, 05 Oct 2012 18:49:20 GMT","X-Powered-By":"PHP/5.4.6","Connection":"close","Content-Length":"17","Pragma":"no-cache","Server":"Apache/2.2.22 (Fedora)","Vary":"Accept-Encoding,Cookie","Content-Type":"text/plain; charset=utf-8","Access-Control-Allow-Origin":"*","Cache-Control":"no-store, no-cache, must-revalidate, post-check=0, pre-check=0","Expires":"Thu, 19 Nov 1981 08:52:00 GMT"}}

Any ideas?
auth.js

Rob Griffiths

unread,
Oct 8, 2012, 1:40:29 AM10/8/12
to jso...@googlegroups.com
Sorry its taken so long.

I notice you're doing the oauth dance manually. I'd only recommend this for experienced users as i provide this functionality in fetchRequestToken and fetchAccessToken http://bytespider.github.com/jsOAuth/api-reference/

Try to rework your code using these methods.
The boilerplate example should help you https://gist.github.com/1071227#file_pin_auth.html

Rob
<auth.js>
Reply all
Reply to author
Forward
0 new messages