Welcome to the new Box Support website. Check out all the details here on what’s changed.

Invalid Grant: Please check the 'jti' claim.

Answered
New post

Comments

4 comments

  • MikeBergerUS

    I'm running into that as well, did you figure out what the issue was?

    0
    Comment actions Permalink
  • pharv

    IIRC, the error message was misleading because it wasn't actually the jti claim that was causing the issue.  I can't remember the exact fix, but I believe it was the exp claim, which must be set to no more than 1 minute in the future, and must be formatted as number of seconds since Unix Epoch, e.g. in PHP it would be "time() + 60".  Also, make sure that the aud claim matches the token URI exactly.

    0
    Comment actions Permalink
  • MikeBergerUS1

    Thanks, the error did seem to be like a misnomer on my end. I've gotten it a few time when there were other Box outages so I'm guessing it could mean there's something down. It seems like the error appeared somewhat less after I removed the iat and nbf claims and increased the exp claim to time() + 60 instead of time() + 10, however this could be purely coincidence.

    0
    Comment actions Permalink
  • MikeBergerUS1

    This issue was getting worse over time and I finally coordinated with Box to figure out my issue. I wasn't making my jti claim unique between my JWTs, I was just using the same value for each JWT generated. I didn't notice any problems for a while however I started seeing it at different times and eventually after a few months I was only getting this error. I fixed this by just generating a jti based on the timestamp (I use PHP so I just used md5 on the current time stamp). 

     

    0
    Comment actions Permalink

Please sign in to leave a comment.