-
1. Re: Seam Security Question
jpalmer1026.jpalmer1026.mchsi.com Jan 21, 2010 7:41 PM (in response to jpalmer1026.jpalmer1026.mchsi.com)I figured out part of the problem. I forgot to make the LoginObserver class a component by adding @Name, so at least now the updateUserStats() method is getting called. The problem I'm now experiencing is related to getting a handle to the user object. When I try to inject the user using the @In annotation, I receive an exception stating that the In attribute requires a non-null value. Does anyone know how I can get a handle to the user object in this scenario?
-
2. Re: Seam Security Question
lvdberg Jan 22, 2010 10:04 AM (in response to jpalmer1026.jpalmer1026.mchsi.com)Hi,
For every @In in LoginObserver you should have an @Out somewhere else. Or you should autocreate the object. Because you're stating that you're doing this in the authenticator, the thing which occurs me is that you're sending the event too early. Try using raise the event after
transaction succesfully completed
Another option is sending the object together with the event.Leo
-
3. Re: Seam Security Question
cbensemann Jan 22, 2010 10:12 PM (in response to jpalmer1026.jpalmer1026.mchsi.com)I do a similar thing in some of my projects. I need to perform some action on the User object after logging in. I use the JpaIdentityStore.EVENT_USER_AUTHENTICATED event as it passes the User object in the event.
You would probably want to do something like:
@Observer(value = { JpaIdentityStore.EVENT_USER_AUTHENTICATED }) public void postAuthenticateListener(final User user) { // do stuff with user..... }