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

JWT Oauth 2.0 using powershell

Answered
New post

Comments

1 comment

  • mwiller

     You're probably making the API call as two different users when you use the different tokens — when you get tokens through the JWT grant with the code you have in your original post, you're authenticated as the Service Account, a special user representing your application in the enterprise the app is authorized in.  This user may not have the permissions or access to view the users in your enterprise, depending on what you've enabled in the Developer Console for your application.  You can verify that this is the problem by making an API call to `GET /users/me` with each type of token to see which account you're authenticated as.  Assuming that's the case, could you try the following steps and let me know if that fixes your problem?

     

    1. In the Developer Console, ego to the Configuration page for your application and ensure that Application Access is set to Enterprise.  Also ensure that the Manage Users Application Scope is checked.
    2. Re-authorize your application for your enterprise — this is done in the Admin Console, and you may need to ask your enterprise administrator to do this for you if you're not the enterprise admin.
    3. Try your code again and verify that you can retrieve the user information you want using JWT auth.
    0
    Comment actions Permalink

Please sign in to leave a comment.