2017-01-11 39 views
-2

我想通過這些步驟來配置客戶端證書驗證我的自由服務器: http://www.ibm.com/support/knowledgecenter/SS7K4U_liberty/com.ibm.websphere.wlp.zseries.doc/ae/twlp_sec_clientcert.htmlIBM自由女神客戶證書驗證

我的自由配置:

<server description="new server"> 
    <!-- Enable features --> 
    <featureManager> 
     <feature>webProfile-7.0</feature>   
     <feature>restConnector-1.0</feature> 
     <feature>localConnector-1.0</feature> 
     <feature>monitor-1.0</feature> 
     <feature>jsp-2.3</feature> 
     <feature>adminCenter-1.0</feature> 
     <feature>ssl-1.0</feature> 
    </featureManager> 

    <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" --> 
    <httpEndpoint id="defaultHttpEndpoint" 
        httpPort="9081" 
        httpsPort="9444" />       

    <application id="Sample" name="Sample" type="war" location="Sample.war"/> 
    <keyStore id="defaultKeyStore" location="key.jks" type="JKS" password="{xor}EzY9Oi0rJg==" /> 
    <keyStore id="defaultTrustStore" location="truststore.jks" type="JKS" password="{xor}EzY9Oi0rJg==" /> 
    <ssl id="defaultSSLConfig" keyStoreRef="defaultKeyStore" trustStoreRef="defaultTrustStore" clientAuthenticationSupported="true"/> 
    <webAppSecurity allowFailOverToBasicAuth="true" /> 

    <auth-method>CLIENT-CERT</auth-method> 
    <basicRegistry id="basic">  
     <user identity="CN=Admin,O=myOrg,C=country" name="Admin" password="admin" />-->   
    </basicRegistry> 

    <administrator-role> 
     <user>Admin</user>  
    </administrator-role> 

</server> 

從Java客戶端,我得到: CWWKX0229E :提供的用戶憑據出現問題。服務器迴應代碼401和消息'未授權'

我想我的用戶映射是錯誤的。有人可以給我一個例子如何映射客戶端證書與自由用戶?

回答

0

是否有意使用證書而不是用戶/密碼登錄Web應用程序?您需要在web.xml中定義CLIENT-CERT。您將不得不在您的瀏覽器上安裝應用程序將訪問的證書。另外,Liberty服務器需要在信任存儲中擁有簽署者證書。如果證書DN名稱確實與註冊表用戶完全匹配,您也可以定義證書過濾器。

可以在server.xml中添加以下命令,以便在客戶端證書身份驗證未成功時使用基本身份驗證。

您可能還需要確認您的應用程序與基本身份驗證工作。

更多細節在: http://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_sec_clientcert.html

+0

我從負荷消費要求使用認證。是的,它適用於基本認證。 使用客戶端證書身份驗證可以擁有管理員角色嗎? – VytautasN

+0

如果您使用自己的Web應用程序進行客戶端證書登錄,則不需要管理員角色,而是您的應用程序定義的角色。如果您嘗試使用管理中心的證書登錄,我懷疑它會起作用。 –

+0

但是,您可能需要通過設置clientAuthentication =「true」來進行客戶端身份驗證/相互SSL,在這種情況下,服務器會請求客戶端發送證書。但是,如果客戶機沒有證書,或者證書不受服務器信任,則握手不成功。在這種情況下,您仍然需要使用用戶名/密碼登錄。 –