public Principal authenticate() throws AuthenticationException {
        try (AlpineQueryManager qm = new AlpineQueryManager()) {
            final ApiKey apiKey = qm.getApiKey(assertedApiKey);
            if (apiKey == null) {
                throw new AuthenticationException();
            } else {
                return apiKey;
            }
        }
    }
public Principal authenticate ( ) throws AuthenticationException { try ( AlpineQueryManager qm = new AlpineQueryManager ( ) ) { final ApiKey apiKey = qm . getApiKey ( assertedApiKey ) ; if ( apiKey == null ) { throw new AuthenticationException ( ) ; } else { return apiKey ; } } }
Authenticates the API key (if it was specified in the X-Api-Key header)
and returns a Principal if authentication is successful. Otherwise,
returns an AuthenticationException.
@return a Principal of which ApiKey is an instance of
@throws AuthenticationException upon an authentication failure
@since 1.0.0