java - Spring Social Signin - Got anonymousUser after SignInAdapter -


everything works anonymoususer security context.

social signin works, (new) user (and implicitly) signed through custom connectionsignup, signinadapter called, sets new auth in context, status 302 when protected page called , got redirected login page. log reports principal=anonymoususer, type=authorization_failure, data={type=org.springframework.security.access.accessdeniedexception, message=access denied}].

this signin adapter

@service public class springsecuritysigninadapter implements signinadapter {    @autowired   private userdetailsservice userdetailsservice;     @override   public string signin(string localuserid, connection<?> connection, nativewebrequest request) {      userdetails userdetails = userdetailsservice.loaduserbyusername(localuserid);      usernamepasswordauthenticationtoken authentication = new usernamepasswordauthenticationtoken(userdetails,             userdetails.getpassword(), userdetails.getauthorities());      securitycontextholder.getcontext().setauthentication(authentication);      return null;   } } 

where error? did miss something? might due context holder strategy?


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -