}
@Override
public Principal handle(HttpRequestContext request) throws NotAuthorizedException, InternalServerException {
try {
Credentials credentials = requestDecoder.decode(request);
Principal result = authenticator.authenticate(credentials);
if (result != null) {
return result;
}
} catch (IllegalArgumentException e) {