jcasbin-springboot-plugin is an authorization middleware for Spring Boot, it's based on https://github.com/casbin/jcasbin. It is developed under the latest Spring Boot 2.0.1
and Java 8
.
git clone https://github.com/jcasbin/jcasbin-springboot-plugin
This project itself is a working SpringBoot project that integrates with jCasbin. The steps to use jCasbin in your own SpringBoot project are:
JCasbinAuthzFilter
's String getUser(HttpServletRequest request) method to make sure jCasbin can get the authenticated user name.JCasbinAuthzFilter
filter is loaded, so it can filter all your requests. To do this, you can copy the WebComponentConfig class into the same folder with JCasbinAuthzFilter
.This project is under Apache 2.0 License. See the LICENSE file for the full license text.