HTTP
Security
JWT
ex)
eyuasdlfhaslkfjaslk.
asdjkfashflasjfkasjfsasldkfjasldjf.
alksdjflkasldfaslkvnasolkejlfjaslkslkan
- Header: 알고리즘과 토큰 타입
{
"alg": "HS256",
"typ": "JWT"
}
- Payload: 데이터
{
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022
}
- Verify Signature
HMACSHA256(
base64URLEncode(header) + "." +
base64URLEncode(payload),
your-256-bit-secret
) secret base64 encoded