hantsy/spring-webmvc-jwt-sample
关于
使用 Spring Security 和基于 JWT 令牌的身份验证保护 REST API
安全与隐私实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文spring-webmvc-jwt-sample
What is this?
This is a sample project that demonstrates how to use JWT token-based authentication to protect RESTful APIs in a Spring Web MVC application.
[!note] If you are interested in the new variant built with the Spring WebFlux stack, check spring-reactive-jwt-sample for more details.
Guide
Please refer to the step-by-step guide for a detailed explanation of the example codes.
The original code was written in Spring Boot 2.0. There are some slight differences in the main/master branch due to the changes introduced in the latest Spring Boot 3.x.
Prerequisites
Please ensure that you have installed the following software.
- Java 21
- Apache Maven 3.9.x/4.0.0+
- Docker
Build
Clone the source code from GitHub.
git clone https://github.com/hantsy/spring-webmvc-jwt-sample
Open a terminal, switch to the project's root folder, and run the following command to build the entire project.
docker compose up postgres // start up a postgres
mvn clean install // build the project
Please proceed with executing the following command to run the application.
mvn spring-boot: run
// or from the command line after building
java -jar target/xxx.jar
Contribution
Any suggestions are welcome, filing an issue or submitting a PR is also highly recommended.
探索相关项目
加载中…