How To Save Spring Security Logged In User In Session
- by Brad Rhoads
This code get's the currently logged in user, using the Spring Security Plugin (acegi):
def principalInfo = authenticateService.principal()
def person = null
if (principalInfo != "anonymousUser" && principalInfo.username) {
person = Person.findByUsername(principalInfo.username)
}
I would like then do:
session.user = person
This…