mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
This modifies the exception thrown for failures in authenticate() so that it
will be serializable. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4796 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -16,6 +16,9 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.security.authentication;
|
package org.alfresco.repo.security.authentication;
|
||||||
|
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.io.StringWriter;
|
||||||
|
|
||||||
import net.sf.acegisecurity.AuthenticationManager;
|
import net.sf.acegisecurity.AuthenticationManager;
|
||||||
import net.sf.acegisecurity.UserDetails;
|
import net.sf.acegisecurity.UserDetails;
|
||||||
import net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken;
|
import net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken;
|
||||||
@@ -66,7 +69,15 @@ public class AuthenticationComponentImpl extends AbstractAuthenticationComponent
|
|||||||
}
|
}
|
||||||
catch (net.sf.acegisecurity.AuthenticationException ae)
|
catch (net.sf.acegisecurity.AuthenticationException ae)
|
||||||
{
|
{
|
||||||
throw new AuthenticationException(ae.getMessage(), ae);
|
// This is a bit gross, I admit, but when LDAP is
|
||||||
|
// configured ae, above, is non-serializable and breaks
|
||||||
|
// remote authentication.
|
||||||
|
StringWriter sw = new StringWriter();
|
||||||
|
PrintWriter out = new PrintWriter(sw);
|
||||||
|
out.println(ae.toString());
|
||||||
|
ae.printStackTrace(out);
|
||||||
|
out.close();
|
||||||
|
throw new AuthenticationException(sw.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user