You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Quarkus使用LDAP表单认证时报Parameter 'credential' may not be null错误

我在使用表单认证(Form Authentication)进行用户身份校验时遇到报错,该问题在使用基础认证(Basic Authentication)时不会出现。

当配置项quarkus.http.auth.form.enabled=false时,基础认证的所有流程运行正常;当我将该配置项修改为quarkus.http.auth.form.enabled=true后,会抛出如下错误:

java.lang.IllegalArgumentException: Parameter 'credential' may not be null
        at org.wildfly.common.Assert.checkNotNullParamChecked(Assert.java:71)
        at org.wildfly.common.Assert.checkNotNullParam(Assert.java:49)
        at org.wildfly.security.auth.server.ServerAuthenticationContext.addPrivateCredential(ServerAuthenticationContext.java:798)
        at io.quarkus.elytron.security.runtime.ElytronTrustedIdentityProvider$1.get(ElytronTrustedIdentityProvider.java:55)
        at io.quarkus.elytron.security.runtime.ElytronTrustedIdentityProvider$1.get(ElytronTrustedIdentityProvider.java:43)
        at io.quarkus.security.runtime.QuarkusIdentityProviderManagerImpl$1$1$1$1.run(QuarkusIdentityProviderManagerImpl.java:58)
        at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:543)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
        at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
        at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:832)

上述配置是我对application.properties做出的唯一修改。从控制台日志可以看到用户已在LDAP中被查询到,但程序仍然抛出该异常。

我使用的Quarkus版本为2.3.0-Final,升级到2.4.1.Final版本后问题仍可复现。

更新

我基于quarkus-security-jdbc创建了可复现该问题的示例仓库,该示例使用LDAP和表单认证实现,仓库地址为:https://github.com/hikemachado/quarkus-ldap-quickstart


感谢各位的帮助。

内容的提问来源于stack exchange,提问作者Henrique Machado

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.27 10:15:03