AuthenticationTokenValidator authenticationTokenValidator;
protected AuthenticationCredentials findCredentials(HttpServletRequest httpRequest) throws Exception {
final String authToken = httpRequest.getHeader("X-Auth-Token");
if (authToken != null) {
AuthenticationCredentials creds = new PlatformLayerAuthenticationCredentials(authToken);
return creds;
}
X509Certificate[] certChain = (X509Certificate[]) httpRequest
.getAttribute("javax.servlet.request.X509Certificate");
if (certChain != null && certChain.length != 0) {
AuthenticationCredentials creds = new CertificateAuthenticationCredentials(certChain);
return creds;
}
return null;
}