Authentication Glassfish 3.1登录名';t提示输入特定URL的凭据
我有一个web应用程序集,可以在每个输入点提示输入用户名和密码。除了一个名为Authentication Glassfish 3.1登录名';t提示输入特定URL的凭据,authentication,login,glassfish,jdbcrealm,Authentication,Login,Glassfish,Jdbcrealm,我有一个web应用程序集,可以在每个输入点提示输入用户名和密码。除了一个名为showStatus的URL之外,所有内容都需要基本身份验证,该URL用于显示应用程序的状态。showStatusURL不需要身份验证。问题是,即使访问了showStatusURL,密码对话框仍会显示。我可以单击“取消”或“确定”仍然访问该页面,但我想知道如何禁用showSessionURL的对话框 以下是web.xml的内容: <!-- constraint for restricted pages -->
showStatus
的URL之外,所有内容都需要基本身份验证,该URL用于显示应用程序的状态。showStatus
URL不需要身份验证。问题是,即使访问了showStatus
URL,密码对话框仍会显示。我可以单击“取消”或“确定”仍然访问该页面,但我想知道如何禁用showSession
URL的对话框
以下是web.xml
的内容:
<!-- constraint for restricted pages -->
<security-constraint>
<display-name>restricted access</display-name>
<web-resource-collection>
<web-resource-name>Secure Pages</web-resource-name>
<description/>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<description/>
<role-name>USERS</role-name>
</auth-constraint>
</security-constraint>
<!-- do not require authentication for showStatus URL -->
<security-constraint>
<web-resource-collection>
<web-resource-name>ShowStatus</web-resource-name>
<url-pattern>/showStatus.action</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
</security-constraint>
<!-- need the login prompt to appear for everything but showStatus -->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>MYREALM</realm-name>
</login-config>
<security-role>
<role-name>USERS</role-name>
</security-role>
受限访问
安全页面
/*
使用者
显示状态
/显示状态
得到
基本的
我的王国
使用者
您的showStatus
页面上很可能有一些安全的资源。当您的页面试图访问这些资源时,会显示密码对话框,因为FacesServlet也提供这些资源
加载showStatus
页面时,您可以使用firebug或一些嵌入式工具检查浏览器中监视网络活动所需的资源。你会看到这样的情况:
只需将此资源URL添加到不需要身份验证的
。或者,您也可以通过添加以下模式授予对所有资源的开放访问权:
<url-pattern>/faces/javax.faces.resource/*</url-pattern>
/faces/javax.faces.resource/*
我仍然无法解决这个问题。有人能帮忙吗?回到你自己的步骤,你可能在配置中也限制了该页面。也许此链接可以帮助您: