Skip to main content

400: {"error":"invalid_grant","error_description":"Please check the 'sub' claim. The 'sub' specified

  • April 14, 2025
  • 1 reply
  • 3 views

Forum|alt.badge.img
  • Community Manager
  • 1196 replies

Hi,

  • I am doing box integration with Salesforce. We are using JWT for authentication. While authentication we are getting invalid sub error. I am passing the enterpriseId in string format and also my app has permission for generating user token and perform action as user. What else could be reason for this error.

1 reply

Forum|alt.badge.img
  • Author
  • Community Manager
  • 1196 replies
  • April 14, 2025

 

 

When the sub is your enterprise ID, then the box_sub_type needs to be enterprise.

 

sub: config.enterpriseID,
box_sub_type: "enterprise",

 

Similarly when trying to create a JWT for a user the sub is your user ID and the box_sub_type should be user.

 

Can you make sure that this is correct in your claim? You can see a full example over here.

 

https://developer.box.com/guides/authentication/jwt/without-sdk/


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