JWT Token由以下三部分组成:

  • PAYLOAD:DATA

    1
    2
    3
    4
    5
    {
    "sub": "1234567890",
    "name": "John Doe",
    "iat": 1516239022
    }
  • VERIFY SIGNATURE

    1
    2
    3
    4
    5
    HMACSHA256(
    base64UrlEncode(header) + "." +
    base64UrlEncode(payload),
    your-256-bit-secret
    )