Grails spring security core, how to set principal manually -


hi im trying make facebook's login in grails app, problem have when user logged in facebook, spring security core doesn't recognize him, how can set user's principal manually? can user object don't know how set in order true user when call getauthenticateduser() (now returns null object)

thanks in advance, regards

cannot regarding facebook, spring security has securitycontextholder can used manipulate authentication (and therefore principal) this:

import org.springframework.security.core.context.securitycontextholder sch import org.springframework.security.web.authentication.preauth.preauthenticatedauthenticationtoken   .... def securitycontext = sch.context def principal = <whatever use principal> def credentials = <...> securitycontext.authentication = new preauthenticatedauthenticationtoken(principal, credentials)  

maybe you'll need use different implementation of authentication interface 1 used in example.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -