简体   繁体   中英

JWT token How to split claim and signature

In JWT token authentication, it is mentioned the "." is used for splitting the 3 parts of token (header, claim, signature). But in-case if my signature or encoded claim contains the "." it would be difficult the exact content of 3 section. Anybosy came across this situation or what is the way to handle it?

I generated signature using HMACSHA256(encoded json claim), but I'm getting "." in middle of the signature data. when i concatenate all the 3 parts, i'm getting one extra "."

The three parts of the JWT token are all base64 encoded and therefore will never contain a dot character.

Even if your claim or signature contains that character, after base64 encoding that part the dot will no longer appear in the output.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM