Answers for "how to displau authentification failure message thymeleaf"

0

how to displau authentification failure message thymeleaf

public class MyAuthenticationFailureHandler implements AuthenticationFailureHandler {

    @Override
    public void onAuthenticationFailure(HttpServletRequest httpServletRequest,
            HttpServletResponse httpServletResponse,
            AuthenticationException e) throws IOException, ServletException {
        httpServletResponse.setStatus(HttpStatus.UNAUTHORIZED.value());
        httpServletResponse.sendRedirect("/login?loginError=true");
    }
Posted by: Guest on December-07-2020
0

how to displau authentification failure message thymeleaf

@Override
protected void configure(HttpSecurity http) throws Exception {
    ...
    .failureHandler(getAuthenticationFailureHandler())
    ...
}
@Bean
public AuthenticationFailureHandler getAuthenticationFailureHandler() {
    return new MyAuthenticationFailureHandler();
}
Posted by: Guest on December-07-2020
0

how to displau authentification failure message thymeleaf

<p class="text-danger" th:if="${param.loginError}" th:text="'Wrong username or password'"></p>
Posted by: Guest on December-07-2020

Browse Popular Code Answers by Language