I trying authenticate user in Spring Security application via oAuth. I'm already received token and user's data.
How can I authenticate user manually without password and classic login form? Thank you.
Something like this:
Authentication authentication = new UsernamePasswordAuthenticationToken(person, null, person.getAuthorities());
log.debug("Logging in with {}", authentication.getPrincipal());
SecurityContextHolder.getContext().setAuthentication(authentication);
Where person
is your UserDetailsBean object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With