Jakarta Security is not logout the user on EAP 7.4

Solution Verified - Updated -


I have the following Jakarta Security implementation on EAP 7.4; However the user is never logout

@ServletSecurity(value = @HttpConstraint(rolesAllowed = {"*"}))
public class LoginServlet extends HttpServlet {

    private static final long serialVersionUID = 6727134101934346153L;

    private static final Logger log = LoggerFactory.getLogger(LoginServlet.class);

    private SecurityContext securityContext;

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        String username = request.getParameter("username");
        String password = request.getParameter("password");

        Credential credential = new UsernamePasswordCredential(username, new Password(password));


        AuthenticationParameters authenticationParameters = withParams().credential(credential);

        AuthenticationStatus status = securityContext.authenticate(request, response, authenticationParameters);

        log.info("Status ...." + status.name());
        log.info("request.getUserPrincipal().getName() ...." + request.getUserPrincipal().getName());

        response.sendRedirect("/test/login.jsp?username=" + request.getUserPrincipal().getName());



  • Red Hat JBoss Enterprise Application Platform (EAP) 7.4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content