public async Task <IApiKey> ProvideAsync(string key)
 {
     try
     {
         return(await _apiKeyRepository.GetApiKeyAsync(key));
     }
     catch (System.Exception exception)
     {
         _logger.LogError(exception, exception.Message);
         throw;
     }
 }
Exemple #2
0
 public async Task <IApiKey> ProvideAsync(string key)
 {
     try
     {
         // write your validation implementation here and return an instance of a valid ApiKey or retun null for an invalid key.
         return(await _apiKeyRepository.GetApiKeyAsync(key));
     }
     catch (System.Exception exception)
     {
         _logger.LogError(exception, exception.Message);
         throw;
     }
 }
Exemple #3
0
 public async Task <ApiKey> GetApiKeyAsync(string apiKey)
 {
     return(await repository.GetApiKeyAsync(apiKey));
 }
        public async Task <bool> VerifyApiKey(string key)
        {
            var existingKey = await _apiKeyRepository.GetApiKeyAsync(key);

            return(existingKey != null);
        }