Skip to main content
Question

Choosing the authentification method

  • May 22, 2025
  • 4 replies
  • 7 views

Forum|alt.badge.img

Hello,

I'm starting to use Box and I'm programming a Python program to import local data that I have with metadatas on templates into Box.

The developper token is working but limited to one hour and the transfer might be longer. I'm facing difficulties to program a refresh token program.

I used the OAuth2 JWT, but I can't use the client object created, I can only create user with it. Therefore, after creating an user to the app, and manually giving the right to access different folders, etc.

How can I use this created user to upload my files ?
I'm a bit confused, so there is maybe a easier way to achieve what I want.

Thank you

4 replies

Forum|alt.badge.img

 

Welcome to Box! Thanks so much for using our platform and development forum. 

 

Are you using our python SDK

 

Best, 


Forum|alt.badge.img

Yes, I actually tried the example (auth.py), but it's launching a localhost server, etc. Can't make it work.

I also followed the following lines : https://github.com/box/box-python-sdk#id4
But I don't understand why you need to create an user and how can you use an already created user ?
Everytime I'm trying a request on any file, I've a 404 error.


Forum|alt.badge.img

 Thanks for the info! Let's go back to your original message so I can get some more context. 

 

"The developer token is working but limited to one hour and the transfer might be longer. I'm facing difficulties to program a refresh token program."

Just in case you don't know, the developer token will be a token associated with the Box account logged into the developer console when you generate this token. Therefore, if you're logged in as xyz@box.com, you can only interact with content xyz@box.com has access to. 

"I used the OAuth2 JWT, but I can't use the client object created, I can only create user with it. Therefore, after creating a user to the app, and manually giving the right to access different folders, etc. How can I use this created user to upload my files ?"

Did you make an app user? You want to upload the content as the app user, correct? 


Forum|alt.badge.img

Yes, with the dev token it's working but it's limited to 1h. Yes, I made an app user and I gave access to the right folders to allow him to upload but how can I get the user created in the code ? Because I can only find how to create this user, not how to use it therefore.