CoderUni
CoderUni

Reputation: 6154

Is the length of a Firebase Auth JWT Token always 1250 characters?

I'm including a Firebase Auth Token as part of my POST request to my REST api. I would want to check if the token.length == 1250 before I decode the token to get the user's uid. I've generated ten different auth tokens and checked all of their length. All of them are 1250 characters in length. Are all of generated tokens' length in 1250 characters or will it sometimes be longer and shorter?

Upvotes: 3

Views: 1268

Answers (1)

Hiranya Jayathilaka
Hiranya Jayathilaka

Reputation: 7438

Token lengths are arbitrary. It depends on the exact information included in the token such as user's name, uid and other custom claims.

Upvotes: 1

Related Questions