protected AuthenticationInfo doAuthenticate(AuthenticationToken token) throws AuthenticationException {
if (token instanceof RootAuthenticationToken) {
return new SimpleAuthenticationInfo(new Object(), null, "openengsb");
}
try {
Authentication authenticate =
authenticator.authenticate(token.getPrincipal().toString(), (Credentials) token.getCredentials());
return new SimpleAuthenticationInfo(authenticate.getUsername(), authenticate.getCredentials(),
"openengsb");
} catch (org.openengsb.domain.authentication.AuthenticationException e) {
throw new AuthenticationException(e);
}
}