我如何设置好Tomcat与LDAP身份验证? [英] How do I set up Tomcat with authentication in LDAP?

查看:290
本文介绍了我如何设置好Tomcat与LDAP身份验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Tomcat中使用LDAP身份验证使用自定义
  授权

"How to use LDAP for authentication in Tomcat with Custom Authorization"

通过在Tomcat中的web.xml LDAP身份验证

"LDAP authentication via web.xml in Tomcat"

LDAP身份验证要求和如何做

"LDAP Authentication Requirements and How to do it"

我似乎不是唯一一个有这个问题挣扎。
在当前的配置,我可以用我的LDAP用户,而不是与系统或Tomcat用户进行身份验证。现在的问题是,每当我登录,我无法获得我应该看到的文件。

I seem to not be the only one struggling with this issue. With the current configuration, I can authenticate with my LDAP users and not with system or tomcat users. The problem is that whenever I'm logged in, I'm denied access to the files I should see.

目前,我有以下信息一个web.xml

I currently have a web.xml with the following info

<security-constraint>
<web-resource-collection>
<web-resource-name>Nrt</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Home</realm-name>
</login-config>

和与下面内容的server.xml中

and a server.xml with the following content

<Realm className="org.apache.catalina.realm.JNDIRealm"
             connectionURL="ldap://192.168.75.146:389"
             userPattern="uid={0},ou=people,dc=localhost,dc=localdomain"
             roleBase="cn=admin,ou=group,dc=localhost,dc=localdomain"
             roleName="cn"
             roleSearch="memberUid={1}"
             debug="99"/>

我试图找到解决的净文档,但我只是卡住了。到目前为止,我已经成功地访问它没有LDAP用户,或LDAP用户登录,并不能访问文件。

I have tried to find documentation around the net, but I'm simply stuck. So far, I've managed to access it without LDAP users, or log in with LDAP users and not access the files.

任何帮助将大大AP preciated。

Any help would be greatly appreciated.

推荐答案

如果我理解正确的话,您可以通过LDAP,但如预期授权一块不工作验证。根据您提供的信息,你缺少你的角色和你的群体之间的映射。你可以找到的说明这里

If I understand it correctly, you can authenticate via LDAP but the authorization piece is not working as expected. Based on the information you have provided, you are missing the mapping between your roles and your groups. You can find the instructions here

这篇关于我如何设置好Tomcat与LDAP身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆