Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Michael Charles
Login Error Messages
2 maggio 2012 10.57
Risposta

Michael Charles

Punteggio: New Member

Messaggi: 15

Data di Iscrizione: 20 gennaio 2011

Messaggi recenti

Looking at the Liferay source, portal-web/docroot/html/portlet/login/login.jsp has different error messages depending on the exception thrown.

1<liferay-ui:error exception="<%= AuthException.class %>" message="authentication-failed" />
2<liferay-ui:error exception="<%= CookieNotSupportedException.class %>" message="authentication-failed-please-enable-browser-cookies" />
3<liferay-ui:error exception="<%= NoSuchUserException.class %>" message="please-enter-a-valid-login" />
4<liferay-ui:error exception="<%= PasswordExpiredException.class %>" message="your-password-has-expired" />
5<liferay-ui:error exception="<%= UserEmailAddressException.class %>" message="please-enter-a-valid-login" />
6<liferay-ui:error exception="<%= UserLockoutException.class %>" message="this-account-has-been-locked" />
7<liferay-ui:error exception="<%= UserPasswordException.class %>" message="please-enter-a-valid-password" />
8<liferay-ui:error exception="<%= UserScreenNameException.class %>" message="please-enter-a-valid-screen-name" />


However, "com.liferay.portal.security.auth.Authenticator" only throws an "AuthException", and prevents any class that implements it from bubbling up a different exception bubble up.

Seems seems like either a bug or an inflexible design.

Are there any thoughts out there as to why this is the case?

If there are no good reason I'd like to submit/recommend changes to com.liferay.portal.security.auth.Authenticator that would allow a more flexible custom authentication experience.

Also for for reference the following thread has some information as well. Changing Login Error Messages
David H Nebinger
RE: Login Error Messages
2 maggio 2012 12.15
Risposta

David H Nebinger

Punteggio: Liferay Legend

Messaggi: 4496

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

Login failures will typically show two failures, the first is the 'invalid data' or something, the second is the valuable one from the language bundle.

I used CSS to disable the display of the first one (since it has little if any value) and only show the good one.