JAAS 登录模块未调用 abort(),安全性 属性 足够

abort() not called on JAAS login module with security property sufficient

当使用 sufficient 标志验证失败时,ActiveMQ Artemis 代理中的 JAAS 模块不调用 abort() 函数。它正在调用 commit(),即使它抛出 FailedLoginException。但是,如果我在 login.config 文件中将安全性 属性 更改为 requisiterequired,当它抛出 FailedLoginException 时调用 abort()。有人知道原因吗?

relevant JavaDoc 关于 sufficient 标志的说明:

[A sufficient] LoginModule is not required to succeed. If it does succeed, control immediately returns to the application (authentication does not proceed down the LoginModule list). If it fails, authentication continues down the LoginModule list.

...

The overall authentication succeeds only if all Required and Requisite LoginModules succeed. If a Sufficient LoginModule is configured and succeeds, then only the Required and Requisite LoginModules prior to that Sufficient LoginModule need to have succeeded for the overall authentication to succeed. If no Required or Requisite LoginModules are configured for an application, then at least one Sufficient or Optional LoginModule must succeed.

换句话说,sufficient 模块不需要成功,因此当它们失败时,似乎 abort() 不是设计调用。

就其价值而言,是 JVM 本身根据 login() 的结果调用 abort()commit() 等。在 ActiveMQ Artemis 中使用登录模块这一事实并不真正相关。