tomcat 7(Linux)active directory JNLIDRealm集成
我正在尝试将Tomcat7(安装在Linux服务器上)与Active Directory集成,如下文档 我已经修改了server.xmltomcat 7(Linux)active directory JNLIDRealm集成,linux,active-directory,tomcat7,jndi,Linux,Active Directory,Tomcat7,Jndi,我正在尝试将Tomcat7(安装在Linux服务器上)与Active Directory集成,如下文档 我已经修改了server.xml <Realm className="org.apache.catalina.realm.JNDIRealm" connectionURL="ldap://dc.domain.local:389" connectionName="tc01@domain.local" connectionPassword="password
<Realm className="org.apache.catalina.realm.JNDIRealm"
connectionURL="ldap://dc.domain.local:389"
connectionName="tc01@domain.local"
connectionPassword="password"
userBase="CN=Users,DC=domain,DC=Local"
userSearch="(&(samAccountName={0})(objectCategory=person)(objectClass=user))"
userSubtree="false"
roleBase="CN=Users,DC=domain,DC=Local"
roleName="cn"
roleNested="true"
roleSearch="(member={0})"
roleSubtree="false" />
我还修改了web应用程序的web.xml
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>group</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Tomcat Manager Application</realm-name>
</login-config>
<security-role>
<role-name>Everyone</role-name>
</security-role>
保护区
/*
删除
得到
职位
放
组
基本的
Tomcat管理器应用程序
每个人
当我尝试使用getRemoteUser()时,我找到了用户名,但没有找到域名
<%
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", 0);
%>
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>TEST AD!</title>
</head>
<body>
<noscript>
Your web browser must have JavaScript enabled in order for this
application to display correctly.</div>
</noscript>
<div id="wa_details">
<div id="wa_user"><%= ((request.getRemoteUser()!=null)?request.getRemoteUser():"") %></div>
</div>
<div id="loader"></div>
</body>
</html>
测试广告!
您的web浏览器必须启用JavaScript才能执行此操作
应用程序以正确显示。
我不明白问题出在哪里
问候
奥罗