如下设置 LdapIdentityStoreDefinition 属性:
@LdapIdentityStoreDefinition(
url = "",
bindDnPassword = "${ALIAS=somepassword}", // this is not working .
callerSearchBase = "",
callerSearchFilter = "",
groupSearchFilter = ""
)
在 Payara 服务器中创建别名 somepasword 如下:
create-password-alias somepassword
Enter the alias password>
Enter the alias password again>
Command create-password-alias executed successfully.
在运行应用程序时出现异常:
[2019-11-26T14:46:42.101-0500] [Payara 5.191] [WARNING] [] [javax.enterprise.system.container.web.com.sun.web.security] [tid: _ThreadID=29 _ThreadName=http-thread-pool::http-listener-1(2)] [timeMillis: 1574797602101] [levelValue: 900] [[
JASPIC: http msg authentication fail
javax.el.PropertyNotFoundException: ELResolver cannot handle a null base Object with identifier 'somepassword'
at com.sun.el.lang.ELSupport.throwUnhandled(ELSupport.java:68)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:126)
at com.sun.el.parser.AstAssign.getValue(AstAssign.java:57)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
at javax.el.ELProcessor.getValue(ELProcessor.java:129)
最佳答案
据我所知,您不能直接在 @LdapIdentityStoreDefinition
中使用环境属性。但是通过 Microprofile Config API 有一个解决方法。
请参阅此论坛主题以供引用:https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/payara-forum/qvoDhtrbxJc/qxs0vTAxAgAJ
关于java - 如何从 @LdapIdentityStoreDefinition 的环境属性/Payara 容器中读取 bindDnPassword 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59058893/