ValidateApiKey()
Validate API key
Description
Validates an API key. If the key is valid, the application name and identifier will also be provided.
Package Details
Interface
IAuthenticationManager
Syntax
AuthenticationManager.ValidateApiKey(ApiKeyValidationContext apiKeyValidationContext);
Returns
Task<ApiKeyValidationResult>
API
[POST] /api/v1/validate-apikey
Parameters
Request Body
{
"ApiKey": "string",
"JwtToken": "string",
"ServiceId": 0
}
Returns
200 OK - API Key Validation result
Example
var apiKeyValidationContext = new ApiKeyValidationContext`
{
ApiKey = "--- YOUR API KEY ---",
JwtToken = "--- YOUR JWT ---",
ServiceId = 11
};
var result = await _authenticationManager.ValidateApiKey(apiKeyValidationContext);
if ( result.Success ){
Response.Write($@"API Key is valid for application: {result.ApplicationName}");
}