GithubHelp home page GithubHelp logo

andy521 / jcasbin-springboot-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paleti/jcasbin-springboot-plugin

0.0 0.0 0.0 26 KB

This repo is DEPRECATED, see this instead:

Home Page: https://github.com/jcasbin/casbin-spring-boot-starter

License: Apache License 2.0

Java 100.00%

jcasbin-springboot-plugin's Introduction

jcasbin-springboot-plugin Build Status Coverage Status

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.

Installation

git clone https://github.com/jcasbin/jcasbin-springboot-plugin

Simple Example

This project itself is a working SpringBoot project that integrates with jCasbin. The steps to use jCasbin in your own SpringBoot project are:

  1. Copy the JCasbinAuthzFilter class to your own project.
  2. Copy authz_model.conf and authz_policy.csv to your project. You can modify them to your own jCasbin model and policy (or loading policy from DB), see Model persistence and Policy persistence.
  3. Replace the HttpBasicAuthnFilter class (which provides HTTP basic authentication) with your own authentication like OAuth, Apache Shiro, Spring Security, etc. Rewrite JCasbinAuthzFilter's String getUser(HttpServletRequest request) method to make sure jCasbin can get the authenticated user name.
  4. Make sure the 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.

Getting Help

License

This project is under Apache 2.0 License. See the LICENSE file for the full license text.

jcasbin-springboot-plugin's People

Contributors

hsluoyz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.