Unable to do auth 2.0 from salesforce . (The only available option for us is through JWT.)

New post

Comments

3 comments

  • Official comment
    Kourtney

    Hello, 

    It would be most helpful if you could supply the api key (aka client ID) of your app, the error you received for invalid or insufficient permissions, and an example date/time/timezone you received it so I can take a closer look within our backend logs. If I had to take a guess at the issue, since you're using JWT, the default token used is going to be associated with the application's service account. This account will not have any access to existing content until you add them as a collaborator. Just like in the webapp, you're only going to successfully be able to interact with content the user associated with your token either owns or has collaborator access to. You can confirm who your token is associated with by using the get current user endpoint

    Best, 

    Kourtney, Box Developer Advocate

    Comment actions Permalink
  • Muhammad Bajwa

    HI,

    Thank you for the feedback. Here is the information you requested.

     

     

            clientId = 'prg0gct7dvijuu0oktuw326i8j3x5q3z';

            endpoint = 'https://api.box.com/oauth2/token';

          Enterprise Id= '784103840';

    Endpoint=https://api.box.com/2.0/folders?fields=id,type,name,folder_upload_email, Method=POST]

    18:49:49:549 CALLOUT_RESPONSE [125]|System.HttpResponse[Status=Forbidden, StatusCode=403]

    18:49:49:549 CALLOUT_RESPONSE [125]|System.HttpResponse[Status=Forbidden, StatusCode=403]

     

    Time: 6:50PM PST --01/06/2020

    0
    Comment actions Permalink
  • Kourtney

    Thanks for the info! This 403 is being cause by sending "sync_state":"synced" in the body. You're not going to be able to do that on a folder creation call. You'll need to make a secondary PUT call to update the folder once its created. Please give that a try and let me know how it goes! 

    0
    Comment actions Permalink

Please sign in to leave a comment.