getting Principal during Grails Spring Security authentication -


I am wrapping the implementation of spring protection in Grails. This is the implementation on my first spring security - I used to use Azegi first.

The problem here is what I am doing. In Asegi, I was able to recover the authenticated user in the on-line interactive etxevent () callback to get access to the user's principle, and then to access SecurityContextHolder while getting the 'live' user from the database. In Spring security, SecurityContaxHold does not appear - when I try to access it, then I receive a low-level Grails complaint about such a method on such an object.

Then, my question:

  • How can I use SecurityContextHolder onInternactiveAuthenticationSuccessEvent

  • or Is there a better way of getting certified theory?

Thank you, donation

It may have to be updated - this Spring Protection was changed from 2 to 3 - it is now org.springframework.security.core.context.SecurityContextHolder , but there has been no change in the methods.

But this is cleaner to use the SpringSecurityService, which is accessible from event callback using the appCtx variable:

  onInactiveAuthenticationSuccessEvent = {E, appCtx - & gt; DEF PRINCIPAL = APCTCXING SECURITY SUPER. Principal Def User = UserGate (Principal.ID)}  

Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -