Код: Выделить всё
@GetMapping("/find")
public List getUsers(){
return service.getUsers();
}
@PostMapping("/loging")
public ResponseEntity Authenticate(@RequestBody Logindetails cred, HttpServletRequest req){
Authentication auth = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(cred.getUsername(),cred.getPassword()));
SecurityContextHolder.getContext().setAuthentication(auth);
return ResponseEntity.ok().body(req.getSession().getId());
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... not-authen