Observe the org.jboss.seam.security.loggedOut event
I need little more direction here. I have got an observer for logout event setup. What should this observer method do? What should be the scope of bean containing observer method? Messages added to current instance of javax.faces.FacesContext don't show up on next page. The observer method is getting executed (can see log statements from this method).
Also, if I want to display additional message after logout based on an other event my app raises while the user is logged in, will this approach work?
Messages added to current instance of javax.faces.FacesContext don't show up on next page.
You should add messages to the Seam FacesMessages component as it is scoped to the conversation which is carried across redirects...
Then again, I believe you are going to have issues here regardless because from my recollection the session is expired by the identity.logout action. The FacesMessages component is scoped to the conversation and the conversation is destroyed along with the session. Thus, any messages you have added will be gone when a new session is created and a temporary conversation is started.
Try out the FacesMessages component though, and let me know what happens...
I wrote a blog posting a little while back on differentiating between a fresh login, session expired, and logout:
It doesn't address your exact scenario but will provide a little insight into the messaging issues with security.