Skip to content

Spring Boot JWT Authentication and Authorization application that also uses a refresh token to renew the access token.

Notifications You must be signed in to change notification settings

EmreSahna/spring_jwt_auth_with_refresh

Repository files navigation

Spring Boot JWT Auth With Refresh Token

Flow Chart

Flow Chart

Application Logic

  • User sends username and password to the server
  • Server validates the credentials and sends back an Access Token and Refresh Token
  • User stores the Access Token in local storage and Refresh Token in a cookie
  • User sends the Access Token in the Authorization header of every request
  • Server validates the Access Token and sends back the response
  • If the Access Token is expired, user sends the Refresh Token in the Cookie header of the request
  • Server validates the Refresh Token and sends back a new Access Token and Refresh Token

Files

Technologies

  • Java 17
  • Spring Boot 3.0
  • Spring Data JPA
  • Spring Security
  • IO JSON Web Token
  • H2 Database
  • Lombok
  • Restful API
  • Maven

Maven Run

To build and run the application with Maven, please follow the directions below;

$ cd spring_jwt_auth_with_refresh
$ mvn clean install
$ mvn spring-boot:run

About

Spring Boot JWT Authentication and Authorization application that also uses a refresh token to renew the access token.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages