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
相关产品推荐
相关产品推荐

