Skip to main content
Box Employee
May 27, 2025 4:19 PM UTC
Question

App authorization request – JWT integration fails with "sub" claim error

Hello,

I’ve created a Custom App using the JWT (Server Authentication) method called ZQ_Demo. I’ve configured the app with App + Enterprise Access and enabled the necessary scopes. However, when I try to authenticate using the Box Node SDK, I receive this error:

Auth Error: Please check the 'sub' claim. The 'sub' specified is invalid. [400 Bad Request] invalid_grant

Can you please confirm whether the app needs to be manually authorized on your side, or if there are any additional steps required for using JWT authentication?

Thank you!

    1 reply

    Box Employee
    May 27, 2025 4:19 PM UTC

    Hi there, 

    Welcome to Box Community and glad to assist! 

    The "sub" claim in the JWT should always be a Box ID — depending on the value of "box_sub_type" it would be either the ID of the user you're trying to generate tokens for or the ID of the enterprise you're authenticating as the service account for. You want to verify this value is correct and that you're passing it as a string.

    More info here.

    Hope it helps!

    Translate