Lightweight Java authentication and authorization framework: login sessions, permissions and roles, SSO, OAuth 2.0 server, gateway and RPC auth, JWT and API signing.
open sourceApache-2.0free
Sa-Token is an Apache-2.0 Java framework for authentication and authorization from the Dromara community. Most checks are one static call or an annotation: log a user in, check login, kick a session out, require a permission or role with @SaCheckPermission, or match routes in an interceptor. It has five core modules: login authentication, permission authentication, single sign-on (three modes, across domains and Redis setups), an OAuth 2.0 server, and microservice authentication for gateways (Spring Cloud Gateway, ShenYu, Zuul) and RPC calls (Dubbo, gRPC). It also covers shared and per-device sessions, Redis persistence, JWT integration, API keys, API parameter signing against tampering and replay, account bans, second-factor re-authentication and impersonation, with starters for Spring Boot 2, 3 and 4, WebFlux, Solon and JFinal. An alternative to Spring Security and Apache Shiro.
Problems it solves
- add login, roles and permission checks to my Spring Boot API without wiring up Spring Security
- set up single sign-on across several Java web apps on different domains
- check authentication at the gateway and pass the login state through Dubbo or gRPC calls
Features
- login authentication with one static call, multi-device and mutually exclusive logins
- permission and role checks by annotation or route interceptor
- single sign-on in three modes, across domains and Redis setups
- OAuth 2.0 server with OpenID mode
- gateway and RPC authentication (Spring Cloud Gateway, ShenYu, Zuul, Dubbo, gRPC)
- JWT integration, API keys and API parameter signing
- Redis-backed sessions, account bans, impersonation and second-factor re-authentication
- starters for Spring Boot 2, 3 and 4, WebFlux, Solon and JFinal
Alternatives
The same job
These do what Sa-Token does.
- Spring Security Authentication and access control for Spring and Java applications
- Apache Shiro Java security framework for authentication, authorization, sessions and cryptography