2009-04-09 42 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