Tomcat和windows集成身份验证
我正在开发一个必须在Tomcat上运行的Java应用程序,我需要能够识别正在加入我的应用程序web的远程用户 此远程用户正在Windows上运行,因此我需要获取他的“Windows登录”(SAMAccountName Active Directory属性) 在IIS上是最简单的。我按照此操作来登录用户 server.xml的内容是:Tomcat和windows集成身份验证,tomcat,windows-authentication,Tomcat,Windows Authentication,我正在开发一个必须在Tomcat上运行的Java应用程序,我需要能够识别正在加入我的应用程序web的远程用户 此远程用户正在Windows上运行,因此我需要获取他的“Windows登录”(SAMAccountName Active Directory属性) 在IIS上是最简单的。我按照此操作来登录用户 server.xml的内容是: <Realm className="org.apache.catalina.realm.JNDIRealm" debug="99" conne
<Realm
className="org.apache.catalina.realm.JNDIRealm" debug="99"
connectionURL="ldap://DAServer:389"
connectionName="userAuth@mydomain.local"
connectionPassword="secret"
referrals="follow"
userBase="OU=mycompany,DC=mydomain,DC=local"
userSubtree="true"
roleBase="OU=groups,DC=mydomain,DC=local"
roleName="name"
roleSubtree="true"
roleSearch="(member={0})"/>
而web.xml的内容是:
<!-- Define a Security Constraint on this Application -->
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>myCompany Users</role-name>
</auth-constraint>
</security-constraint>
<!-- Define the Login Configuration for this Application -->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>myRealm</realm-name>
</login-config>
<!-- Security roles referenced by this web application -->
<security-role>
<description>The role that is required to log in to APP</description>
<role-name>myCompany Users</role-name>
</security-role>
整个应用程序
/*
myCompany用户
基本的
我的王国
登录到应用程序所需的角色
myCompany用户
我需要自动登录。您必须使用Tomcat JNDI领域,并将其与服务器的active directory集成
尝试一些指导原则如果您正在构建一个Intranet应用程序,并且正在寻找SSO,那么您可以使用类似的基于SSO的方法。我添加了有关我的问题的更多详细信息。也许我不需要新的库,我只需要像IIS一样集成windows身份验证。Jespa不基于JCIFS。JCIFS NTLM HTTP过滤器在许多方面都有缺陷,因此用这种方式描述Jespa是非常不幸的。Jespa只是将JCIFS用于MS-RPC层和一些基本的NTLM计算。但是API和功能没有任何相似之处。OP的公认答案是指向重复的链接