sds
Oct 14th, 2004, 10:21 AM
In my JAASLoginModule, I throw a subclass of LoginException upon InvalidCredentials, UserNotFound, .... However, the current LDAPProvider does not foresee a way to resolve the LoginException into an Acegi exception. I could just throw an Acegi exception straight away, but that would mean that the JAAS login module is dependent on Acegi, while it is the other way around.
To make a long story short, could the class JaasAuthenticationProvider be alter to call a method for resolving the LoginException, so I can subclass it and provide my own resolver ?
public Authentication authenticate(Authentication auth)
try {
....
} catch (LoginException e) {
context.publishEvent(new JaasAuthenticationFailedEvent(auth, e));
// This could become the implementation of resolveLoginException(e); so I can subclass and change behavior
//We have no way of knowing what caused the exception, so we cannot throw BadCredentialsException, DisabledException, or LockedException.
//So we'll just throw an AuthenticationServiceException
throw new AuthenticationServiceException(e.toString());
}
Stefaan
To make a long story short, could the class JaasAuthenticationProvider be alter to call a method for resolving the LoginException, so I can subclass it and provide my own resolver ?
public Authentication authenticate(Authentication auth)
try {
....
} catch (LoginException e) {
context.publishEvent(new JaasAuthenticationFailedEvent(auth, e));
// This could become the implementation of resolveLoginException(e); so I can subclass and change behavior
//We have no way of knowing what caused the exception, so we cannot throw BadCredentialsException, DisabledException, or LockedException.
//So we'll just throw an AuthenticationServiceException
throw new AuthenticationServiceException(e.toString());
}
Stefaan