Welcome to the new Box Support website. Check out all the details here on what’s changed.

.Net SDK Access normal users folders and files using JWT, Oauth

New post

Comments

2 comments

  • jcleblanc

    Hi ,

     

    Wen you added the "perform actions as users" and "generate user access token" options to your JWT app, did you also reauthorize the application in the admin console to ensure the changes were applied to the app? Also make sure that "Application Access" setting is set to "Enterprise" if you are trying to access managed users in the overall enterprise. That would be the first thing that I would check.

     

    Next, for sending an as-user header instead of the user access token method, this guide should provide those details.

     

    Hope that helps,

    Jon

    0
    Comment actions Permalink
  • mikitaka

    Thank you Jon!

     

    I re-authorized my application. Up to this far, it is all fine.

     

    Then I tried to get BoxClient by

    var user_client = new BoxClient(config, session, asUser: '[USER_ID]');

    The parameters:

    config : no problem, I have configuration read from my appSettings.json.

    session: ?

    asUser: [USER_ID] -- 9 digit number 2*******7

     

    Here the session I am not quite sure of. This is my question this time.

     

    When I use OAuth2, my system accesses 

    https://account.box.com/api/oauth2/authorize?client_id=xxxx

    to be redirected to the designated url with Authorization Code, where I use

    var session = boxClient.Auth.AuthenticateAsync(code).Result;

     

    Do I have to go through the same flow to get the session?

     

    I appreciate you help me.

    0
    Comment actions Permalink

Please sign in to leave a comment.