OAuth Permissions
Thinker
Registered Users Posts: 6 Beginner grinner
Hi,
I just started trying to integrate SmugMug into my desktop application and am currently working on the OAuth stuff.
I have the basics working (requesting a token, getting user authorization, and getting an access token).
I was wondering if there is any way to pass the appropriate parameters for requesting permissions (READ, ADD, UPDATE) from the user. Right now it appears as though whenever I launch the URL to get user authorization, it always defaults to READ.
Along those lines, would additional parameters need to be passed when getting the request token, or on the URL when launching the page?
Thanks.
I just started trying to integrate SmugMug into my desktop application and am currently working on the OAuth stuff.
I have the basics working (requesting a token, getting user authorization, and getting an access token).
I was wondering if there is any way to pass the appropriate parameters for requesting permissions (READ, ADD, UPDATE) from the user. Right now it appears as though whenever I launch the URL to get user authorization, it always defaults to READ.
Along those lines, would additional parameters need to be passed when getting the request token, or on the URL when launching the page?
Thanks.
0
Comments
In the authorize url, you can pass Access and Permissions as parameters.
Access - Full or Public (default)
Permissions - Read (default), Add or Modify
My bad, I need to update the documentation there...I'm in the process of adding support for OAuth 1.0a so I need to update that documentation anyway.
Cheers,
David
SmugMug API Developer
My Photos
Thanks David!
David,
FYI... the Access and Permissions parameters seem to be case sensitive... so it has to be "Access=Full" vs "access=full" or any other variation.
Seems a bit restrictive (and makes a little more work for me ). It would be nice if it supported all lowercase (or were case insensitive).
It works though, so thanks again for the help!
One thing I forgot to mention previously, though you are able to request the Access/Permissions that you want...the user is able to modify the both via the control panel, so your app needs to be able to handle that.
Calling smugmug.auth.getAccessToken or smugmug.auth.checkAccessToken both return the current Access and Permissions.
Cheers,
David
SmugMug API Developer
My Photos
FYI... I seem to have hit a bug with IE and the control panel. When I change the Access or permissions via the control panel page and submit using IE 8 (on Windows 7), i see the "Updating application" dialog, but the permissions and access never get updated.
It works fine in Firefox, so it seems like its an IE 8 specific issue.