'Handler function not recognized in Spring Boot App

What can be done for this segment of code throwing an error for handler.onAuthenticationFailure

 [.logout(l -> l
      .logoutSuccessUrl("/").permitAll()
            )
      .oauth2Login(o -> o   
      .failureHandler((request, response, exception) -> {
                        request.getSession().setAttribute("error.message", 
       exception.getMessage()).
/* *this part here* */ ->  **handler**
     .onAuthenticationFailure(request, response, exception);
                        })
                );]


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source