This sample application explores how to create an authentication and authorization server that uses JWT tokens implemented with Spring Security framework.
- Git
- Docker
- Java SDK 21
- IntelliJ IDEA
- Clone this repository to your computer.
# Option 1: SSH
% git clone git@github.com:RenanKummer/samples-jwtauthserver-springsecurity.git
# Option 2: HTTPS
% git clone https://github.com/RenanKummer/samples-jwtauthserver-springsecurity.git
-
Start Docker engine.
-
Open a terminal and run the following commands:
# Navigate to project root directory.
% cd /path/to/project
# Download and boot dependency containers with Docker Compose.
% docker-compose up
-
Open the project directory in IntelliJ.
-
Create run configuration.
- Open
Run / Edit Configurations...
. - Press Add New Configuration and select Spring Boot.
- Fill the required fields:
- Name: Local
- Build and run > JDK: Your JDK
- Build and run > Classpath:
samples-jwtauthserver-springsecurity.main
- Build and run > Main class:
samples.jwtauthserver.springsecurity.JwtAuthServerApplication
- Open
-
Run application with
Local
configuration.