if (TRACE)
log.trace("About to check authorization, using security domain '" + am.getSecurityDomain() + "'");
// Step 1 - Authenticate using currently associated principals.
SecurityAdaptor securityAdaptor = secAdapterfactory.newSecurityAdapter();
Principal principal = securityAdaptor.getPrincipal();
Object credential = securityAdaptor.getCredential();
Subject subject = new Subject();
if (am.isValid(principal, credential, subject) == false)
{
String msg = "Authentication failed, principal=" + principal;
log.error(msg);
SecurityException e = new SecurityException(msg);
throw new FailedAuthenticationException(e);
}
securityAdaptor.pushSubjectContext(subject, principal, credential);
if (TRACE)
log.trace("Authenticated, principal=" + principal);
// Step 2 - If unchecked all ok so return.