Wir haben unsere Anwendung von Spring & Hibernate 3.x auf 4.x aktualisiert. Das Problem ist, dass AuthenticationException.getAuthentication() jetzt veraltet ist. Kann jemand eine Alternative dazu vorschlagen? Unten ist der Code, den wir verwendet haben:Ersatz für AuthenticationException.getAuthentication();
public ModelAndView init(HttpServletRequest request, HttpServletResponse response){
AuthenticationException exception = (AuthenticationException)request.getSession().getAttribute(WebAttributes.AUTHENTICATION_EXCEPTION);
Authentication loginAuthentication = exception.getAuthentication();
//Set the user name for the change password screen
return new ModelAndView("common/changePassword", "userName", loginAuthentication.getPrincipal());
}
mir jemand auf den Ersatz für diese verweisen. Nicht viel ist online verfügbar.
See [Was die Ersetzung von AuthenticationException.getAuthentication ist() in Spring4.0.3] (http://stackoverflow.com/q/39524178/1553851) – shmosel
geprüft Bereits auf diesen Link, keine Lösung gibt – Sid
'SecurityContextHolder .getContext(). getAuthentication() 'und' SecurityContextHolder.getContext(). setAuthentication (Authentication) '. – manish