Demo address: github.com/Snailclimb/… . Welcome to star!

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

However, compared with other technologies such as JPA, Spring Security is more difficult to learn. Many people cannot write a Demo independently by watching videos or sending documents at the beginning of learning, so they may give up learning it later.

Spring Security, a powerful Security authentication framework, was used in the actual training project when I first joined the company and the project I am doing now. It can be seen that this framework is a good choice in the field of identity authentication and permission authentication. I am not familiar with Spring Security because I did not do this module in my previous project. So I took the time to learn this part of the knowledge, and to achieve a simple Demo. This Demo mainly uses Spring Security and Spring Boot technologies, and all dependencies are the latest stable versions. In addition to the initial project, the technology of JPA was also used. The code structure of the project is as follows (Chrome plug-in: Octree), the overall is relatively clear, due to my own ability and time is limited, so there must be a lot of places to optimize, interested friends can improve together, looking forward to your PR. Demo address: github.com/Snailclimb/…

Download the configuration

  1. Git clone github.com/Snailclimb/…
  2. Open the project and wait for Maven to download the dependencies. It is recommended to use IDEA and make sure your IDEA is loaded with lombok.
  3. Modify theapplication.propertiesChange the database connection information to your own.

The sample

1. Create an account

2. Login

3. Use the correct Token to access the resources that require authentication

4. Access resources requiring authentication without the Token

5. Use an incorrect Token to access resources that require authentication

The public,

If you want to follow my updated articles and shared dry goods in real time, you can follow my official account.

“Java interview assault “: derived from this document designed for the interview and born of the “Java interview assault” V2.0 PDF version of the public number background reply “Java interview assault “can be free!

Necessary learning resources for Java engineers: Some Java engineers commonly use learning resources public account background reply keyword “1” can be free of routine access.