2011-03-18 84 views
0

我在我的Glassfish服務器上做了一個基本的登錄,當我嘗試時,用戶名和密碼被識別並接受但沒有加載,瀏覽器似乎試圖加載一些東西,而只是坐在最初的頁面。Glassfish not loading安全頁面

我已經在文件領域作出了一個帳戶,登錄被成功識別。

,它會彈出登錄的鏈接是:<a href="secureUser/secret.xhtml">

web.xml我有這樣的:

<security-constraint> 
     <display-name>UserConstraint</display-name> 
     <web-resource-collection> 
      <web-resource-name>User</web-resource-name> 
      <description/> 
      <url-pattern>/secureUser/*</url-pattern> 
     </web-resource-collection> 
     <auth-constraint> 
      <description/> 
      <role-name>user</role-name> 
     </auth-constraint> 
</security-constraint> 
<login-config> 
     <auth-method>BASIC</auth-method> 
     <realm-name>file</realm-name> 
</login-config> 
<security-role> 
     <description/> 
     <role-name>user</role-name> 
</security-role> 

任何想法,爲什麼它不會加載secret.xhtml

謝謝!

+0

鏈接是什麼? – OleTraveler 2011-03-18 17:24:56

+0

對不起,鏈接是:「secureUser/inside.xhtml」 – FBryant87 2011-03-18 18:52:40

回答

1

有你在sun-web.xml中添加一個安全角色的映射,這種類似這樣的:

<security-role-mapping> 
    <role-name>user</role-name> 
    <principal-name>admin</principal-name> 
</security-role-mapping> 

與文件領域的用戶名替換的<principal-name>內容。

如果這沒有幫助:您可以更改glassfish安全模塊的日誌記錄。在管理控制檯中將javax.enterprise.system.core.security模塊的日誌級別更改爲FINEST

希望這會有所幫助!