/shiro-casdoor

Apache Shiro Integration with Casdoor

Primary LanguageJavaApache License 2.0Apache-2.0

shiro-casdoor

build License Discord

This plugin contains a Shiro Realm for Casdoor which will validate Casdoor JWT access tokens.

This plugin provides a Shiro Realm that will authenticate requests with an Authorization: Bearer <access-token> header.

To use the realm, first define and configure the CasdoorShiroRealm.

The JWT claim information can be retrieved from the current Shiro Subject by casting the principal to CasdoorUser:

import org.casbin.casdoor.entity.CasdoorUser;
...
        
CasdoorUser casdoorUser = (CasdoorUser) SecurityUtils.getSubject().getPrincipal();

See the examples to help you get started even faster:

We also publish these libraries for Java: