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.
- Hard code stuff first (size, etc.) then gradually create the UI & allowing specific things to be set. (Mainly, size & quality of the rendered jpg.)
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.