Why header and payload in the JWT token always sta

2019-04-23 12:51发布

问题:

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?

回答1:

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=



标签: jwt