How to use jwt in springboot

Xiao Qiang Lv4

java spring-boot jwt

  • what is jwt
    • jwt (json token token), s a standard that is mostly used for securing REST APIs.
    • how to sign a toke
      • JWTs can be signed using a secret (with the HMAC algorithm) or a public/private key pair using RSA or ECDSA.
      • the structure of jwt
        • jwt token is componented by the following three parts (always like xxx.xxx.xxx)
          • header, tell the service the type of the token and the encoding algorithm
            1
            2
            3
            4
            {
            "alg": "HS256",
            "typ": "JWT"
            }
          • payload
            • different claim
              • Registered claims: issuer, expiration time, subject
              • Public claims: name
              • Private claims:
          • signature
            • to encode the header, payload and secret
  • why we use jwt
    • authentication
    • authorization
  • how to use jwt token
    • the framework of jwt usage
      sequence diagram of jwt usage
    • code implementation
      how to implement

source code

  • Title: How to use jwt in springboot
  • Author: Xiao Qiang
  • Created at : 2023-03-05 14:24:03
  • Updated at : 2025-03-08 10:49:30
  • Link: http://fdslk.github.io/tech/java/spring-boot/jwt/2023/03/05/integration-jwt/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments
On this page
How to use jwt in springboot