Skip to main content

Error while authenticating the Box app with the Python SDK using JWT

  • July 26, 2023
  • 1 reply
  • 318 views

pratyush_mp

So I have been trying to authenticate the Box app with the Python SDK using JWT, but I am getting an error.


“BoxOAuthException:

Message: Please check the ‘sub’ claim. The ‘sub’ specified is invalid.

Status: 400

URL: https://api.box.com/oauth2/token

Method: POST”


I have crossed checked the “enterprise_id” value which is specified in the config file (the box account which I am currently using is a personal one, so the enterprise in this case was showing as ‘0’).


Also providing the python code which was written for this use-case:


from boxsdk import JWTAuth, Client


auth = JWTAuth.from_settings_file(‘/Users/pratyush/Downloads/0_pvp4byup_config.json’)

client = Client(auth)

service_account = client.user().get()

print(f’Service User Account id is {service_account.id}')

1 reply

smartoneinok Box
Forum|alt.badge.img

Hello! 👋


Unfortunately, in order to use the JWT auth type for an app, you will need to have a paid version of a Box Enterprise account with access to the admin console. We are currently working on creating a free developer enterprise account option for developers to use.


Thanks,

Alex, Box Developer Advocate 🥑


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings