Skip to content

myriad-personal/casbin-spring-boot-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Casbin Spring Boot Demo

A simple Spring Boot application demonstrating the usage of casbin with role claims such as we have with our Okta JWTs. The idea is to demonstrate how an application may use a small core set of enterprise roles and other identity claims from a central identity authority and use them to build a rich domain specific authorization context.

This application doesn't integrate with a real source of identity and all the data is kept in memory only (no persistence). It's a bare-bones demo of how we may leverage Casbin for authorization.

Usage

  1. Clone the repository locally.
  2. Take the application.properties.template and save it as application.properties in the root, next to the template.
    • adjust the paths to the files -- I've not found a way to NOT specify the fully qualified path.
  3. Launch the application however you prefer to launch spring boot applications with a maven build.
  4. Send requests with the following headers:
    1. user-subject: the value can be whatever
    2. user-roles: any set of coma separated values

Tools

used to enable resource server functionality

  • ...

Concerns/Questions

  1. How can we account for scenarios like bloxlet-coral-config that needs an enumeration of user permissions in order to filter for the available applications/features. Essentially, Casbin supports asking questions about access for a given resource.
    • One way is to iterated over all the known applications, features, ... and check access for each one in turn (Enforcer.enforce() for each one).
    • Another way may be to bring the Casbin enforcer to the front end; it's supported, check it out.
    • Finally, the active policies can be pulled out of the enforcer and parsing out all the role hierarchies should be able to product the desired set.
    • Some related resource on the web:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages