if (credentials == null || userId == null) {
log.debug("Could not extract userId/credentials");
return false;
}
Authentication authentication = new UserAuthentication(userId, getUserManager());
boolean success = authentication.authenticate(credentials);
if (success) {
principals = getPrincipals(userId);
log.debug("Adding Credentials to shared state.");
sharedState.put(SHARED_KEY_CREDENTIALS, credentials);