Subject serviceSubject = new Subject();
Map sharedState = getSharedState(request,config);
AuthStatus status = AuthStatus.FAILURE;
while(!status.equals(AuthStatus.SEND_CONTINUE))
{
status = gam.validateRequest(authParam, clientSubject, serviceSubject);
if(status.equals(AuthStatus.FAILURE))
throw new SecurityException("Authentication failed");
}
Principal authenticatedPrincipal = this.getAuthenticatedPrincipal(clientSubject);
return null;