我有一个由LDAP领域支持的工作安全域,如下所示:
/subsystem=elytron/ldap-realm=***censored***:query
{
"outcome" => "success",
"result" => {
"allow-blank-password" => false,
"dir-context" => "***censored***",
"direct-verification" => true,
"identity-mapping" => {
"rdn-identifier" => "sAMAccountName",
"use-recursive-search" => true,
"search-base-dn" => "***censored***",
"attribute-mapping" => [
{
"from" => "cn",
"to" => "roles",
"filter" => "(&(objectClass=group)(member={1}))",
"filter-base-dn" => "***censored***"
},
{"from" => "company", "to" => "company"},
{"from" => "givenName", "to" => "firstName"},
{"from" => "sn", "to" => "lastName"},
{"from" => "mail", "to" => "email"}
],
"user-password-mapper" => {"from" => "userPassword"}
}
}
}
授权是针对从LDAP属性映射中提取的标识属性“roles”进行的。
现在,这个方法已经成功了,我想从LDAP中获取更多的属性(company、firstName、lastName、email,可能还有更多)。上面的配置已经拾取了这些内容,而Elytron以我所期望的方式处理它们:
<TS> DEBUG [org.wildfly.security] (default task-6) [javax.naming.ldap.InitialLdapContext@5c7e4fb4] successfully created. Connection established to LDAP server.
<TS> DEBUG [org.wildfly.security] (default task-6) Trying to create identity for principal [*****].
<TS> DEBUG [org.wildfly.security] (default task-6) Executing search [(sAMAccountName={0})] in context [*****] with arguments [*****]. Returning attributes are [MAIL, SN, GIVENNAME, COMPANY]. Binary attributes are [null].
<TS> DEBUG [org.wildfly.security] (default task-6) Found entry [*****].
<TS> DEBUG [org.wildfly.security] (default task-6) Identity for principal [*****] found at [*****].
<TS> DEBUG [org.wildfly.security] (default task-6) Executing search [(&(objectClass=group)(member={1}))] in context [*****] with arguments [*****, *****]. Returning attributes are [null, CN]. Binary attributes are [null].
<TS> DEBUG [org.wildfly.security] (default task-6) Found entry [*****].
.
. bunch of group memberships
.
<TS> DEBUG [org.wildfly.security] (default task-6) Found entry [*****].
<TS> TRACE [org.wildfly.security] (default task-6) Identity iterating - pagination not supported - end of list
<TS> DEBUG [org.wildfly.security] (default task-6) Obtaining authorization identity attributes for principal [*****]:
<TS> DEBUG [org.wildfly.security] (default task-6) Identity [*****] attributes are:
<TS> DEBUG [org.wildfly.security] (default task-6) Attribute [lastName] value [*****].
<TS> DEBUG [org.wildfly.security] (default task-6) Attribute [firstName] value [*****].
<TS> DEBUG [org.wildfly.security] (default task-6) Attribute [roles] value [*****].
<TS> DEBUG [org.wildfly.security] (default task-6) Attribute [roles] value [*****].
<TS> DEBUG [org.wildfly.security] (default task-6) Attribute [roles] value [*****].
<TS> DEBUG [org.wildfly.security] (default task-6) Attribute [roles] value [*****].
<TS> DEBUG [org.wildfly.security] (default task-6) Attribute [roles] value [*****].
<TS> DEBUG [org.wildfly.security] (default task-6) Attribute [roles] value [*****].
<TS> DEBUG [org.wildfly.security] (default task-6) Attribute [roles] value [*****].
<TS> DEBUG [org.wildfly.security] (default task-6) Attribute [company] value [*****].
<TS> DEBUG [org.wildfly.html" target="_blank">security] (default task-6) Attribute [email] value [*****].
<TS> DEBUG [org.wildfly.security] (default task-6) Context [javax.naming.ldap.InitialLdapContext@5c7e4fb4] was closed. Connection closed or just returned to the pool.
所以.总结一下。不管这是一个LDAP领域。我需要的属性在Identity对象中可用。该标识随后被转换为没有这些属性的主体,据我所知,主体是我可以通过EJB会话上下文访问的东西。
有没有任何方法可以从EJB获取标识,或者至少获取标识的视图?最好是以实现不可知的方式?
最诚挚的问候!
/Magnus Drougge
要从EJB获取当前的安全标识,可以使用以下代码:
SecurityDomain.getCurrent().getCurrentSecurityIdentity()
有关SecurityDomain的更多详细信息可在此处找到:
http://wildfly-security.github.io/wildfly-elytron/master/org/wildfly/security/auth/server/securitydomain.html
我试图在Wildfly25上的Elytron上配置LDAPS,我不知道我错过了什么。
如何在不使用Azure函数属性的情况下检索Azure函数中的“秘密值”? null 我有一个应用程序,它在Azure KeyVault中秘密地存储了密钥/值对。在存储数据时,我保留标识符以备以后检索: 存储该值的代码为:
我目前的问题是,我的机器上运行了两个Wildfly 8.2.0最终实例。我知道,有类似的问题,但没有一个真正有助于我的问题。其中一个拥有一个宁静的应用程序,当它收到GET时,它会触发无状态会话Bean。之后,此无状态会话 Bean 应从远程无状态会话 Bean 调用方法该方法位于另一个 wildfly 实例上。 我将从解释我到目前为止所做的事情开始(也许我错过了一些东西,我对Java EE和Wil
19.2. 访问EJB 19.2.1. 概念 为了调用一个本地或者远程无状态session bean上的方法,通常客户端的代码必须进行JNDI查找,获取(本地或远程的)EJB Home对象,然后调用该对象的"create"方法,才能得到实际的(本地或远程的)EJB对象。如此一来,调用的方法比调用EJB组件本身的方法还要多。 为了避免重复的底层代码,很多EJB应用使用了服务定位器(Service L
我正在遵循教程和: 将一个ejb部署到Wildfly 8- Wildfly在部署ejb时返回此消息: 我的客户端尝试: 错误: 我向客户端添加了以下库(除了ejb本身):/library/WildFly/modules/system/layers/base/org/jboss/as/appclient/main/WildFly-appclient-8.1.0。最终的jar(编译范围) 老实说,不确
问题内容: 是否可以从EntityManager中获取Hibernate Session对象?我想访问一些hibernate特定的API … 我已经尝试过类似的东西: 但是,一旦我在EJB中调用方法,我就会收到带有NullPointerException的“在EJB上调用期间发生系统异常” 我用玻璃鱼3.0.1 问题答案: Bozho和partenon是正确的,但是: 在JPA 2中,首选机制是e