Configuration method of spring boot integrated Shiro
Spring boot provides a built-in authentication framework and a custom javaconfig configuration extension. Spring security is also an excellent framework, but I am used to using the Apache Shiro framework, and the original project is an integrated Shiro framework. I went to the Internet to find a configuration method, but I didn't find a complete configuration method, so I decided to do it myself!
To integrate other frameworks on the spring boot, you must first understand the spring javaconfig method, which can also be used to configure other modules. Stop talking nonsense and start...
Before starting, you need to import Maven dependencies (Shiro web optional):
Take out the configuration of the original Shiro integrated spring, as follows:
Many classes cannot be configured one by one. The javaconfig file is as follows:
Note: the last one is filterChainDe@R_301_1292 @For the initialization of nmap, the map is initialized with LinkedHashMap. When you apply, configure it as a properties file, and then the initialization is OK. After rewriting, directly start OK and move it to the spring boot. It should be OK.
Don't forget in ehcache Shiro xml
Note: please refer to the official documentation for shirorealmimpl class
summary
The above is the configuration method of spring boot integrated Shiro introduced by Xiaobian. I hope it will help you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!