I plugged in another authentication mechanism. When I try a logging in with a non-existent account I do not get a polite error message, but go to http://localhost:8080/alfresco/jsp/error.jsp.
Is there a way for me to tidy it up, so the user sees an error-message on the login page itself?
For example, on http://localhost:8080/alfresco/jsp/error.jsp the user sees the following. =================================== javax.faces.FacesException: Error calling action method of component with id loginForm:submit
caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{LoginBean.login}
caused by: net.sf.acegisecurity.BadCredentialsException: Invalid username, password or server configuration (JNDI Context).; nested exception is javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
Yes that should be no problem - that is currently what the LoginBean.login() method does - but it is expecting an exception of type: org.alfresco.repo.security.authentication.AuthenticationException If you make your authentication method throw an exception of this type, then it will be caught and turned into a more friendly error by the loginbean and you will get the effect you want.