https://github.com/casdoor/shiro-casdoor
Apache Shiro Integration with Casdoor
https://github.com/casdoor/shiro-casdoor
apache auth authentication authorization casdoor integration oauth oidc plugin realm shiro
Last synced: about 1 year ago
JSON representation
Apache Shiro Integration with Casdoor
- Host: GitHub
- URL: https://github.com/casdoor/shiro-casdoor
- Owner: casdoor
- License: apache-2.0
- Created: 2022-02-15T14:59:16.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-06T09:59:38.000Z (almost 3 years ago)
- Last Synced: 2025-03-03T11:19:44.484Z (over 1 year ago)
- Topics: apache, auth, authentication, authorization, casdoor, integration, oauth, oidc, plugin, realm, shiro
- Language: Java
- Homepage: https://shiro.apache.org/integration.html
- Size: 13.7 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# shiro-casdoor
[](https://github.com/casdoor/shiro-casdoor/actions/workflows/maven-ci.yml)
[](http://www.apache.org/licenses/LICENSE-2.0.txt)
[](https://discord.gg/5rPsrAzK7S)
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 ` header.
To use the realm, first [define and configure](https://shiro.apache.org/realm.html#realm-configuration) the `CasdoorShiroRealm`.
The JWT claim information can be retrieved from the current Shiro Subject by casting the principal to `CasdoorUser`:
```java
import org.casbin.casdoor.entity.CasdoorUser;
...
CasdoorUser casdoorUser = (CasdoorUser) SecurityUtils.getSubject().getPrincipal();
```
See the examples to help you get started even faster:
- [casdoor-spring-boot-shiro-example](https://github.com/casdoor/casdoor-spring-boot-shiro-example)
We also publish these libraries for Java:
- [casdoor-java-sdk](https://github.com/casdoor/casdoor-java-sdk)
- [casdoor-spring-boot-starter](https://github.com/casdoor/casdoor-spring-boot-starter)