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.
<s:intercept-url pattern="/signin/**" access="" /> In the newer versions of spring security there is a better and faster way of skipping security for eg. <s:http security="none" pattern="/assets/**"/> with the new format the given solution will not work as there is no SecurityContextHolder created in later scenario.