Apache Shiro 认证定制

Apache Shiro authentication customization

如何在 Apache Shiro 中自定义身份验证逻辑?在 Spring Security 中,我在 AuthenticationManager:

的 "authenticate()" 方法中编写自定义逻辑

public Authentication authenticate(Authentication auth) { ... }

有没有办法在 Apache Shiro 中做同样的事情?

这里是 Shiro authentication sequence and customizable realm authentication 的概述。

根据您想做什么,您自己的 CredentialsMatcher 实现可能就是您要找的钩子?关于您需要自定义哪些部分的详细答案实际上取决于您的实际身份验证场景。