I have the same issue as in this other ticket, but I have identified that I receive SEND_CONTINUE when a redirect or forward to the login form occurs. Also, I'm using Wildfly 27.0.1, with Jakarta bindings (jakarta. namespace).
Relevant items...
ApplicationConfig.java:
@CustomFormAuthenticationMechanismDefinition(loginToContinue =
@LoginToContinue(loginPage = "/login.xhtml", useForwardToLogin = true))
@FacesConfig
@ApplicationScoped
public class ApplicationConfig {
}
web.xml
<security-constraint>
<web-resource-collection>
<web-resource-name>index</web-resource-name>
<url-pattern>/index.xhtml</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>ADMINISTRATOR</role-name>
<role-name>USER</role-name>
</auth-constraint>
</security-constraint>
LoginBacking.java:
public void login() throws IOException {
switch (continueAuthentication()) {
case SEND_CONTINUE:
facesContext.responseComplete();
break;
case SEND_FAILURE:
facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Login failed", null));
break;
case SUCCESS:
facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Login succeeded", null));
externalContext.redirect(externalContext.getRequestContextPath() + "/index.xhtml");
break;
case NOT_DONE:
facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Login failed", null));
break;
}
}
private AuthenticationStatus continueAuthentication() {
return securityContext.authenticate((HttpServletRequest) externalContext.getRequest(),
(HttpServletResponse) externalContext.getResponse(),
AuthenticationParameters.withParams().credential(new UsernamePasswordCredential(username, password)));
}
Authentication is handled by a JSR-375 identity store, which is being called correctly, and is returning correctly.
If I go to index.xhtml, and get the login page, authentication always returns SEND_CONTINUE. If I go to login.xhtml, authentication always returns SUCCESS. Further, while SecurityContext.getCallerPrincipal is not null, it is an instance of AnonymousCallerPricinipal, rather than the caller principal I return from my IdentityStore. Notice that this behavior does not depend on the useForwardToLogin setting.
Notice that nowhere do I have a "multipart authentication" configured.
Anyone have any up to date thoughts on this?