Skip to main content
Question

Setting password for private key when using JWTAuth via box-python-sdk

  • May 21, 2025
  • 2 replies
  • 8 views

Forum|alt.badge.img

Greetings,

 

I'm working on some Python processes that use the Box API. I'm looking at using JWTAuth via the box-python-sdk; looks to save a few steps when in comes to building the assertion. Related doc here: https://github.com/box/box-python-sdk#box-developer-edition

 

I am getting this error: TypeError: Password was not given but private key is encrypted.

 

This is because my private key has a password and I need to pass this as a parameter when instantiating the Client with a JWTAuth instance. I cannot find the parameter name.

 

I can create a .pem file without a password but I would think there is a parameter I can use to pass along the password.

 

Any help would be greatly appreciated! I haven't contacted the support email for the SDK yet - thinking this might be useful to others.

2 replies

Forum|alt.badge.img

Thanks to the supporter(s) of the Python SDK, found my answer: "The JWTAuth class has a rsa_private_key_passphrase parameter: <https://github.com/box/box-python-sdk/blob/master/boxsdk/auth/jwt_auth.py#L30>."


Forum|alt.badge.img

Thanks for updating the thread with the answer!