I have a secured JSF 2.2 application where I have the following link in the menu of my application:
<h:link value="Donors" styleClass="fa fa-link"
outcome="/users/donors.xhtml" />
When I access the application(without an active session/login) and click on the link I am then prompted to authenticate(Form based container authentication is in use in conjunction with the Wildfly database authentication module)and should be redirected to the secured page after successful authentication, however the returned html sometimes comes back almost empty(as below):
<html>
<head>
</head>
<body cz-shortcut-listen="true">
<pre style="word-wrap: break-word; white-space: pre-wrap;"></pre>
</body>
</html>
If I access the URL in my browser directly or simply refresh the page , then the page is rendered correctly. As you can see below GET and POSTS to the page in question are restricted to logged in users with either ADMIN or USER role
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<filter>
<filter-name>noCache</filter-name>
<filter-class>org.omnifaces.filter.CacheControlFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>noCache</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<security-constraint>
<web-resource-collection>
<web-resource-name>user</web-resource-name>
<url-pattern>/users/*</url-pattern>
<http-method>POST</http-method>
<http-method>GET</http-method>
<http-method>PUT</http-method>
<http-method>DELETE</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>ADMIN</role-name>
<role-name>USER</role-name>
</auth-constraint>
Can anyone advise why I might be experiencing this issue?