OAuth Permissions

ThinkerThinker 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.

Comments

  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited August 3, 2009
    Thinker wrote:
    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.


    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
    David Parry
    SmugMug API Developer
    My Photos
  • ThinkerThinker Registered Users Posts: 6 Beginner grinner
    edited August 4, 2009
    devbobo wrote:
    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

    Thanks David!
  • ThinkerThinker Registered Users Posts: 6 Beginner grinner
    edited August 4, 2009
    OAuth permissions
    devbobo wrote:
    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

    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 :D). It would be nice if it supported all lowercase (or were case insensitive).

    It works though, so thanks again for the help!
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited August 4, 2009
    yeah, i will have a think about it.

    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
    David Parry
    SmugMug API Developer
    My Photos
  • ThinkerThinker Registered Users Posts: 6 Beginner grinner
    edited August 4, 2009
    IE bug on control panel
    devbobo wrote:
    yeah, i will have a think about it.

    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

    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.
Sign In or Register to comment.