16 Star 321 Fork 137

SnailClimb / spring-security-jwt-guide

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README-ENGLISH.md 2.78 KB
一键复制 编辑 原始数据 按行查看 历史
SnailClimb 提交于 2019-09-28 15:54 . Update README-ENGLISH.md

spring-security-jwt-guide

Introduce

Spring Security is a very powerful framework in the Spring family for authentication and permission control, and we can easily extend it to meet our current system security requirements.

However, compared with some other technologies such as JPA, Spring Security is more difficult to get started. Many people can hardly write a Demo independently after reading video or sending documents, so they may give up learning this thing later.

Spring Security, a powerful Security authentication framework, has been used in the induction training practical project when I first came to the company and the projects I am working on now. It can be seen that this framework is a good choice in the field of authentication and permission authentication. I am not familiar with Spring Security because I did not make this part of the module of the previous project by myself. So I took the time to learn this part of knowledge and implemented a simple Demo. This Demo mainly USES Spring Security and Spring Boot, and all the dependencies adopt the latest stable version. Beyond the initial project, the JPA technology was also used. The code structure of the project is as follows (chrome plug-in: octree), which is relatively clear as a whole. Due to my limited ability and time, there must be a lot of areas that can be optimized. Interested friends can improve it together.

Setup

  1. git clone https://github.com/Snailclimb/spring-security-jwt-guide.git
  2. open project and wait maven to install project Dependencies
  3. change application.properties change the database connection information parameter to your own
  4. Run the project (related data tables will be created automatically, if you don't understand, take a look at JPA)

Example

1.Register an account

Register

2.Login

Login

3.Access resources that require authentication with the correct token

Access resources that require authentication

4.Access resources that require authentication without token

Access resources that require authentication  without token

5.Access resources that require authentication with not correct token

Access resources that require authentication  with not correct token

Reference

Java
1
https://gitee.com/SnailClimb/spring-security-jwt-guide.git
git@gitee.com:SnailClimb/spring-security-jwt-guide.git
SnailClimb
spring-security-jwt-guide
spring-security-jwt-guide
master

搜索帮助