我需要幫助配置GF3.1.2我做了以下更改,請讓我知道如果我失去了重要的東西,因爲改變後它不工作。 我的ID是[email protected]Glassfish 3.1.2配置客戶端證書相互認證
我找不到任何特定的線程或在論壇上的答案,如果有任何鏈接是有幫助的。 如果您有任何文件請轉發。
請做要緊
的web.xml
<login-config>
<auth-method>CLIENT-CERT</auth-method>
</login-config>
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/faces/*</url-pattern>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<description/>
<role-name>authorized</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-role>
<description/>
<role-name>authorized</role-name>
</security-role>
sun-web.xml中
<security-role-mapping>
<role-name>authorized</role-name>
<principal-name>admin</principal-name>
<group-name>authorized</group-name>
</security-role-mapping>
domain.xml中
<security-service>
<auth-realm classname="com.sun.enterprise.security.auth.realm.file.FileRealm" name="admin-realm">
<property name="file" value="${com.sun.aas.instanceRoot}/config/admin-keyfile"></property>
<property name="jaas-context" value="fileRealm"></property>
</auth-realm>
<auth-realm classname="com.sun.enterprise.security.auth.realm.file.FileRealm" name="file">
<property name="file" value="${com.sun.aas.instanceRoot}/config/keyfile"></property>
<property name="jaas-context" value="fileRealm"></property>
</auth-realm>
<auth-realm classname="com.sun.enterprise.security.auth.realm.certificate.CertificateRealm" name="certificate">
<property name="assign-groups" value="authorized"></property>
</auth-realm>
請更具體地說明「不工作」。你在建什麼樣的應用程序?你確定客戶端工作正常嗎? – TPete 2012-04-23 09:22:48
具體來說,我的博客並不是要求客戶端證書,我想用客戶端證書來驗證用戶,我已經在glassfish服務器上做了特定的更改。 – user1347618 2012-04-23 17:12:34
所以當我在瀏覽器中打網址時,它應該要求客戶端證書?我對嗎。 – user1347618 2012-04-23 17:48:22