// if we found a valid user, initialize user id and groups
if (userId != null) {
try {
setupUser(client, userId);
} catch (UnsupportedCallbackException uce) {
AuthException ae = new AuthException();
ae.initCause(uce);
throw ae;
}
} else if (requestPolicy.isMandatory()) {
// otherwise, if the login is mandatory, it's a failure, since
// there was no user id
return AuthStatus.SEND_FAILURE;
}
} catch (IOException ioe) {
AuthException ae = new AuthException();
ae.initCause(ioe);
throw ae;
}
// if we made it this far, we authenticated properly or authentication
// wasn't required. Good news!