Skip to content

JWT Auth Server with Spring Security

Notifications You must be signed in to change notification settings

RenanKummer/samples-jwtauthserver-springsecurity

Repository files navigation

JWT Auth Server with Spring Security

This sample application explores how to create an authentication and authorization server that uses JWT tokens implemented with Spring Security framework.

Local Setup

Pre-requirements

How to run?

  1. 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
  1. Start Docker engine.

  2. 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
  1. Open the project directory in IntelliJ.

  2. Create run configuration.

    1. Open Run / Edit Configurations....
    2. Press Add New Configuration and select Spring Boot.
    3. 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
  3. Run application with Local configuration.