简体   繁体   中英

Seam/JSF - Multiple messages on login failure?

I'm using JBoss Seam 2.2 in my application, and am seeing some strange behavior in the way login failures are handled. When a user fails authentication using #{identity.login}, I see multiple JSF messages being displayed. One has the message key org.jboss.seam.loginFailed , while the other has the key org.jboss.seam.NotLoggedIn . I would obviously expect the first message, as that corresponds to entering an incorrect password. However, why is the second message being displayed? There's no reason for it. I'd like to be able to remove that from the list of messages displayed when it's not necessary, but I haven't found a way to do so. Thoughts?

org.jboss.seam.security.FacesSecurityEvents adds the org.jboss.seam.NotLoggedIn message when it observes the org.jboss.seam.security.notLoggedIn event. The org.jboss.seam.security.notLoggedIn event is raised when an attempt is made to access a resource that requires a certain level of authorization, but the user is not logged in.

After authentication fails, is the user being redirected to a protected page? Do you have any custom login logic that might be accessing a protected resource?

I suggest providing your pages.xml, components.xml, and any custom authentication logic you might have.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM