box / box-python-sdk-gen

Repository for generated Box Python SDK
Apache License 2.0
20 stars 4 forks source link

Box JWT Authentication: New Permission Error #190

Open kdomsohn opened 3 weeks ago

kdomsohn commented 3 weeks ago

Hello,

I ran into a new issue where I am unable to change the Box status of an admin user. This is something my script has been doing for over 2 years now but stopped working sometime in the past few weeks. Have there been updates to limit the scope of JWT authentication? The Box dev app has not been changed either.

Any help would be appreciate and can provide any more information needed.

Thanks, Kyle

mwwoda commented 3 weeks ago

Hi @kdomsohn From the description it doesn't seem like the issue related strictly to the SDK, so your best bet would be probably to reach out to the Box Developer Community.

Sample code wouldn't hurt, so maybe you could post the part of the script that is causing the problems. Also, did you use the script with our older python sdk? Did the problem start occuring after upgrade?

kdomsohn commented 3 weeks ago

Hi @mwwoda,

Appreciate your response. Yes I agree that this appears to be something outside of the SDK and I created a ticket with Box.

Also, for more information I am able to change the status of managed users and admin users but unable to for the Primary Admin.

Sample of the code below:

def switch_user_status(client, user_id, to_inactive=True): ''' Switch the user's status to or from "inactive" status given a Box user ID. ''' user = client.user(user_id).get() print(f"User: {user.name}-User ID: {user.id}") if to_inactive: user.update_info(data = {'status': 'inactive'}) else: user.update_info(data = {'status': 'active'})
return