Skip to content

Sample project using Spring Security 6 with JPA+H2 DB+JUnit. Spring Security 6のサンプルプロジェクト。

Notifications You must be signed in to change notification settings

N-Laboratory/spring-security6-sample-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Security 6 Sample Project

Twitter: N-LAB

日本語版 README はこちら

Sample project using Spring Security 6. This project use following.

  • Spring Security 6
  • Spring Data JPA
  • H2 database
  • JUnit 5

I created this project for learning Spring Security 6, because recent Spring Security (5.x) has drastically changed security settings, and Spring Security 6 has further deprecated or removed more functions.

You can do the following in this project.

  • Login
  • Logout
  • Show user account info
  • Test spring security by JUnit.

This project use H2 Database in-memory mode. So you don't have to build database environment.

Prerequisites

Make sure you have installed all of the following prerequisites on your development machine:

  • Git - Download & Install Git. OSX and Linux machines typically have this already installed.
  • Java - Download & Install Java and set JAVA_HOME.

You also have to build spring-boot running environment (Eclipse or VSCode) in advance.

Usage

Eclipse

  • Click SpringSecuritySampleApplication.java
  • Right click and run as Java Application

VSCode

  • Click SpringSecuritySampleApplication.java
  • Right click and click Debug Java

You can access following page.

Run unit tests

Test spring security login authentication by JUnit.

Eclipse

  • Click LoginTestEngVer.java
  • Right click and run as JUnit Test

VSCode

  • Click LoginTestEngVer.java
  • Right click and click running the current test file

Author

👤 Naoki Nakanishi

About

Sample project using Spring Security 6 with JPA+H2 DB+JUnit. Spring Security 6のサンプルプロジェクト。

Resources

Stars

Watchers

Forks

Packages

No packages published