Level up your Box knowledge with brand new learning paths on Box University. Visit training.box.com to get started

Is it possible to access a shared external folder using JWT authentication?

Answered
New post

Comments

4 comments

  • Official comment
    Kourtney

    Hello Arthur, 

    External content cannot be accessed via the as-user header. Therefore, you will need to directly obtain an access token for the user. 

    Best,

    Kourtney

    Comment actions Permalink
  • Arthur Duarte

    Hi Kourtney, thanks for your answer.
    Do you know, how could I get this token for the user and how can I use it with a JWT authentication client?

    0
    Comment actions Permalink
  • Kourtney

    Arthur, 

    This is done in your JWT assertion. You'll want to set the box_sub_type=user and sub=userID you want the token for. 

    Best, 

    Kourtney

    1
    Comment actions Permalink
  • Arthur Duarte

    Hi Kourtney,
    This link that I your shared was very useful and I could move on with the JWT assertion.

    Specially the Code Samples section, where there is this github repo with complete code examples on how to use the JWT assertion, in my case using Python3:
    https://github.com/box-community/samples-docs-authenticate-with-jwt-api/blob/master/sample.3.py

    I just used this code and the modifications that you suggested for the token and it works, I can access and modify the external folder.

    Thanks a lot.




    0
    Comment actions Permalink

Please sign in to leave a comment.