Api using Oauth and image URL's
matthewpjw
Registered Users Posts: 6 Beginner grinner
I've been integrating smugmug in to an website to allow users to move photos to and from smugmug, the website is using oauth to authenticate with smugmug. (I'm using C# and should be able to release my smugmug/Oauth classes if anyone is interested...)
When I get an image and get the url's for the various sizes from smugmug it seems that the user must hold a smugmug cookie within their browser to access the image, or smugmug returns a 404 to the browser?
How do I use the API to return an image url that is valid without the browser being directly authenticated with smugmug???
Matt
When I get an image and get the url's for the various sizes from smugmug it seems that the user must hold a smugmug cookie within their browser to access the image, or smugmug returns a 404 to the browser?
How do I use the API to return an image url that is valid without the browser being directly authenticated with smugmug???
Matt
0
Comments
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Surely the point of authenticating with oauth and capturing the users token is so the api gives out url's that are accessable without aving to have exteral lnking or other features switched on?
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Right. Super-secret URLs are bad. I would expect that Oauth would set the proper cookie for you.
Oauth by itself is generally used to give a 3rd party temporary access to some of your protected resources without having to give the 3rd party your login credentials (e.g. a book printer access to your photos so they can use them to print a book for you).
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
But he did!
To me it seemed clear that he wants to let SmugMug users login on his website (with Oauth) and move their images to/from SmugMug. So, they'll need the cookie to be able to see their own images and select them for exporting to his website.
If Oauth gives you the right cookie (and I don't see any reason why it shouldn't -- they're your photos) this should work.
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
The Oauth process does set a cookie and the whole process works fine untill a user opens up our website on another browser or deletes their cookies, at that point the user doesn't see thumbnails of their image when browsing smugmug. We also integrate with Facebook, Flickr and Picasa and don't have this issue.
It sounds like its a case of educating the end user - it should be easy to detect the 404 that is returned and ask them to log in again though.
Matt