I can't log user manually (after successful registration) becouse ContextHolder.getContext(); return null.
This is fragment of my spring Controller:
Thanks for help,Code:try { UsernamePasswordAuthenticationToken upat = new UsernamePasswordAuthenticationToken(user.getEmail(), user.getPassword()); Authentication auth = authenticationManager.authenticate(upat); SecureContext c = (SecureContext) ContextHolder.getContext(); c.setAuthentication(auth); //NullPointerException here } catch (AuthenticationException e) { log.info("Authentication request failed: " + e); }
Arthur


