我想在apache 3.0.3中激活Ldap登录模块。
我的karaf-jaas-module.xml是;
.
.
.
<jaas:config name="karaf" rank="2">
<jaas:module className="org.apache.karaf.jaas.modules.ldap.LDAPLoginModule" flags="required">
initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory
connection.username=admin
connection.password=xxxxxxx
connection.protocol=
connection.url=ldap://activedirectory_host:389
user.base.dn=cn=orcladmin,cn=users,dc=vmldapdevelop,dc=com
user.filter=(sAMAccountName=%u)
user.search.subtree=true
role.base.dn=ou=Groups,ou=there,DC=local
role.name.attribute=cn
role.filter=(member=%nsdn)
role.search.subtree=true
authentication=simple
</jaas:module>
</jaas:config>
.
.
.我在卡拉夫控制台上写了jaas:领域列表,而没有看到LdapLoginModule。
karaf@root()> jaas:realm-list
Index | Realm Name | Login Module Class Name
----------------------------------------------------------------------------
1 | karaf | org.apache.karaf.jaas.modules.properties.PropertiesLoginModule
2 | karaf | org.apache.karaf.jaas.modules.publickey.PublickeyLoginModule我该怎么做?
发布于 2015-05-05 08:30:54
是的,它在蓝图文件夹中。这个文件夹在jaas_module包中。但是改变这个xml中的任何东西,karaf没有看到它。因为它覆盖了它。
我解决我的问题。我创建了新的xml文件,它的名称是ldap-module.xml,我的配置在其中。我把这个xml放在部署文件夹中。
因此,我的新xml覆盖了其他xml,当我在karaf控制台上编写“jaas:realm”时,我看到了这个输出;
__ __ ____
/ //_/____ __________ _/ __/
/ ,< / __ `/ ___/ __ `/ /_
/ /| |/ /_/ / / / /_/ / __/
/_/ |_|\__,_/_/ \__,_/_/
Apache Karaf (3.0.3)
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
karaf@root()>
karaf@root()>
karaf@root()>
karaf@root()> jaas:realm-list
Index | Realm Name | Login Module Class Name
-----------------------------------------------------------------------
1 | karaf | org.apache.karaf.jaas.modules.ldap.LDAPLoginModule
karaf@root()>谢谢。
发布于 2015-04-30 12:49:40
我怀疑xml可能在包中的错误位置。它应该在OSGI/蓝图中,就像其他蓝图上下文一样。您还需要在蓝图xml的标题中设置正确的命名空间防御。
您可以通过执行bundle:services来检查蓝图xml是否已被处理。您应该看到一个BlueprintContainer服务。如果没有,则蓝图要么根本不被拾取,要么扩展程序发现一个错误。您可以使用diag命令显示蓝图错误。
https://stackoverflow.com/questions/29966365
复制相似问题