Lightroom, Sta.sh and OAuth

So, I’ve been looking through the OAuth RFC, and this actually looks doable, with copious amounts of code from the Flickr plugin bundled with the Lightroom SDK.

The key thing is OAuth2 – It looks a lot simpler than OAuth1. Whereas OAuth1 needed messages to be signed, OAuth2 just throws stuff back and forth in the URL query string, and a smattering of JSON solely for the authorization token.

Use Resource owner password credentials, where the user will enter the username/password combination. The Facebook plugin tried the ‘standard’ OAuth thing (user logs in, confirms they allow the app, server issues a particular token to the app), but the plugin fell over at the “issuing to app’ bit. Link would open in Lightroom, but it wouldn’t authenticate. Never mind, dA only seems to want the response_type=code bit, and only type=code. type=token just fails silently. Now I’ll need to mock up a webpage to display the code. =|

Instead of doing the placebo call, I’ll just try and grab the user’s dA symbol instead, and display that. Though, on second thought, I should probably do the placebo call and stick it in a function so I can call it before uploading a photo just to check that the token still works. Leave the dA symbol bit though.

This entry was posted on December 20, 2011, 3:40 pm by Kyle Lexmond and is filed under Programming. You can follow any responses to this entry through RSS 2.0.
You can leave a response, or trackback from your own site.