cancel
Showing results for 
Search instead for 
Did you mean: 

Login.bean complaints with new authentication...

crittendonr
Champ in-the-making
Champ in-the-making
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]

caused by:
javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
===================================
2 REPLIES 2

kevinr
Star Contributor
Star Contributor
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.

Thanks,

Kevin

crittendonr
Champ in-the-making
Champ in-the-making
Thank you Kevin,

A few lines of java-code and all is set now.

Rollin