views:

28

answers:

0

I am trying to authenticate the user after I got credentials using oAuth (with Twitter if that makes a difference). As far as I could understand it, I can directly put the Authentication object into SecurityContextHolder. Here is how I do it:

Authentication auth = new TwitterOAuthAuthentication(member,
userDetailsService.loadUserByUsername(member.getUsername()).getAuthorities());
SecurityContextHolder.getContext().setAuthentication(auth);

This for some reason does absolutely nothing. What am I missing and what should I do to accomplish what need?

related questions