Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Simple SpringBoot security demo with jCasbin

Really simple spring security demo. Protected data is accessible only after login. After login, each request must use same cookie JSESSIONID, because server is tracking http sessions by this cookie.

  • Authentication is handled by internal service
  • Authorization is handled by jCasbin library using RBAC model example in combination with Spring's Method Security.


	"userName": "bob",
	"password": "secret"


Users, Passwords and Roles

  • alice / secret, ROLE_USER
  • bob / secret, ROLE_USER, ROLE_ADMIN

Get protected data

GET protected data for different user roles:

Change protected data

Set protected data for admin user roles:

Build and run

gradle clean build 
java -jar build/libs/spring-jcasbin-0.0.1-SNAPSHOT.jar 
You can’t perform that action at this time.