【发布时间】:2018-01-11 18:49:25
【问题描述】:
我的欢迎屏幕是任何网站的主屏幕(应该是不受保护的资源)。
说http://domain:port/myApp 重定向到web.xml 的welcome-file-list 中配置的jsp 文件说welcome.jsp。
但是在点击welcome.jsp 上的任何链接时,这些资源必须受到保护,相应的url 将类似于http://:port/myApp/someRequest
我在部署描述符中使用了以下更改:
<security-constraint>
<web-resource-collection>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>SuperUser</role-name>
</auth-constraint>
<user-data-constraint>
<description>Encryption is not required for the application in general.
</description>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<url-pattern>/styles/*</url-pattern>
<url-pattern>/welcome.jsp</url-pattern>
</web-resource-collection>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>MyRealm</realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/loginerror.jsp</form-error-page>
</form-login-config>
</login-config>
问题仍然是我的主页,即welcome.jsp 受到保护,应用程序重定向到WebSphere Application 服务器的登录屏幕,但在tomcat 和Wildfly 中工作正常。
如何使 http://:port/myApp 在 WebSphere 中不受保护。
【问题讨论】:
-
您好,您能否确认它是在您明确指定 URL 中的welcome.jsp (host:port/myApp/welcome.jsp) 还是仅在您访问w/o welcome.jsp (host:port/myApp) 时提示?
-
host:port/myApp/welcome.jsp 工作正常,即无需任何身份验证。
标签: security jakarta-ee websphere web.xml websphere-liberty