Skip to main content
Question

Phyton SDK and JWT "error_description":"OpenSSL unable to verify data

  • May 21, 2025
  • 2 replies
  • 33 views

Forum|alt.badge.img

Anybody that could help me to get this solve please? 

I'm getting the error "error":"invalid_grant","error_description":"OpenSSL unable to verify data:

 

I'm using Python SDK and I'm trying to authenticate with JWT. 

 

 

def login(self, enterprise_id, user_id, rsa_private_key_file_sys_path, rsa_private_key_passphrase):

        self.jwt_auth = JWTAuth(client_id=self.client_id,

                                client_secret=self.client_secret,

                                enterprise_id=enterprise_id,

                                jwt_key_id=JWT_KEY_ID,

                                rsa_private_key_file_sys_path=rsa_private_key_file_sys_path,

                                rsa_private_key_passphrase=rsa_private_key_passphrase,

                                store_tokens=self.store_tokens)

                                # box_device_name='test')

        self.access_token = self.jwt_auth.authenticate_app_user(User(None, user_id))

        # self.access_token = self.jwt_auth.authenticate_instance()

        self.client = Client(self.jwt_auth)

2 replies

Forum|alt.badge.img

I've seen this error before. I don't know why it happens, but one way you might be able to get around it is by using a different algorithm. e.g. JWTAuth(..., jwt_algorithm="RS512")


Forum|alt.badge.img


Thanks for your suggestion. I have tried RS512 but still got the error massage. The whole exception as the following:

[11:55]
BoxOAuthException:
Message: {"error":"invalid_grant","error_description":"OpenSSL unable to verify data: "}
Status: 400
URL: https://api.box.com/oauth2/token
Method: POST

 


The app account info and user account info can be authenticated via our Java test application, but got this error via our Python test application.