2009-04-09 80 views
2

我正在开发一个必须在Tomcat上运行的JAVA APP,我需要能够识别正在加入我的应用程序Web的远程用户。Tomcat和windows集成认证

这个远程用户运行在一个窗口,所以我需要得到他的“Windows登录”(sAMAccountName活动目录属性)。

在IIS上最简单。我按照这个Detect user logged on a computer using ASP.NET app来获取用户登录

server.xml中的内容是:

<Realm 
    className="org.apache.catalina.realm.JNDIRealm" debug="99" 
    connectionURL="ldap://DAServer:389" 
    connectionName="[email protected]" 
    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> 

我需要自动登录。

回答

0

你必须使用Tomcat的JNDI的境界,并将其与服务器的Active Directory

整合尝试here一些指引

+0

我添加了更多关于我的问题的细节 – VansFannel 2009-04-09 09:53:33

1

如果你正在建立一个Intranet应用,并正在寻找SSO,那么你可以使用的东西像Jespa这是基于jCIFS

+0

也许我不需要一个新库,我只需要像IIS那样集成Windows身份验证。 – VansFannel 2009-04-14 09:43:11