Why header and payload in the JWT token always starts with eyJ
I am using JWT
token to authorize my APIs, during implementation I found header and payload in token always start with eyJ
. What does this indicate?
JWTs consist of base64url encoded JSON, and a JSON structure just starts with {"...
, which becomes ey...
when encoded with a base64 encoder.
The JWT header starts with {"alg":...
, which then becomes eyJ...
You can try on this online encoder and enter {"alg"
and click on encode. The result will be eyJhbGciPSA=