try {
URI uri = getUri(request);
ImmutableMap<String, String> authorizationHeaders = this.server.splitAuthorizationHeader(request.getHeader(AUTHORIZATION));
HawkCredentials credentials = credentialProvider.findByKey(authorizationHeaders.get("id"));
if (authorizationHeaders.get(CALCULATED_HASH) != null) {
hash = Hawk.calculateMac(credentials, CharStreams.toString(new InputStreamReader(request.getInputStream(), ENCODING)));
}
server.authenticate(credentials, uri, request.getMethod(), authorizationHeaders, hash, hasBody(request));