对于在wildfly 8.2上运行的Web应用程序,我们认为这是一个非常标准的基于表单的身份验证。
身份验证效果很好,但是当我们停止并启动服务器时,某些用户无法再次登录。
我设法重现了这个的一个变体: 如果我在重新启动之前打开登录页面/ xxxx / app,然后在服务器再次启动后尝试登录,我最终会出现一个空白/ xxxx / j_security_check页面。 在我的日志中,我可以看到实际的身份验证运行正常。
如果我已正确理解这个j_security_check机制,它就是这样的:
如果这在概念上是正确的,我可以看到重启可能很麻烦;网络服务器不再记住/ xxxx / app地址,也不知道将我重定向到哪里。
有没有人有解决此问题的方法? 有没有什么方法可以在j_security_check之后给wildfly一个默认页面?
编辑:我发现了这个:它可能是同样的根本原因: Jboss Wildfly 8.1 session timeout on login page
的JBoss-web.xml中:
<jboss-web>
<security-domain>ptsmc</security-domain>
<default-encoding>UTF-8</default-encoding>
</jboss-web>
的web.xml:
<servlet-mapping>
<servlet-name>main</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>
<!-- -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<security-constraint>
<display-name>ptsmc</display-name>
<web-resource-collection>
<web-resource-name>ptsmc</web-resource-name>
<url-pattern>/app/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>WEB</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/error.html</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description>Users must have this role to be granted access to Application</description>
<role-name>WEB</role-name>
</security-role>
的login.jsp:
<form name="login_form" method="POST" action="<%=response.encodeURL(request.getContextPath() + "/j_security_check")%>">
<table>
<tr><td>User id:</td><td><input type=text name=j_username autofocus onblur="this.value = this.value.toUpperCase();"></td></tr>
<tr><td>Password:</td><td><input type=password name=j_password></td></tr>
<tr><td> </td><td><input type=submit value="Submit"></td></tr>
</table>
</form>