if (userHeader == null)
{
throw new CredentialsNotSetException(event, event.getSession().getSecurityContext(), this);
}
Credentials user = new MuleCredentials(userHeader, getSecurityManager());
Authentication authResult;
JaasAuthentication authentication = new JaasAuthentication(user);
authentication.setEvent(event);
try
{
authResult = getSecurityManager().authenticate(authentication);
}
catch (SecurityException se)
{
// Security Exception occurred
if (logger.isDebugEnabled())
{
logger.debug("Security Exception raised. Authentication request for user: " + user.getUsername()
+ " failed: " + se.toString());
}
throw se;
}
catch (Exception e)
{
// Authentication failed
if (logger.isDebugEnabled())
{
logger.debug("Authentication request for user: " + user.getUsername()
+ " failed: " + e.toString());
}
throw new UnauthorisedException(
CoreMessages.authFailedForUser(user.getUsername()), event, e);
}
// Authentication success
if (logger.isDebugEnabled())
{