Refactor and Test Application Controller and ApiKey Access Authorization Handling ...
This commit is contained in:
@@ -14,6 +14,7 @@ using xIdentityService.Constants;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace xIds.Providers
|
||||
{
|
||||
@@ -56,6 +57,7 @@ namespace xIds.Providers
|
||||
/// Handle Authorization Filtering Using Tasks ...
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
private async Task OnAuthorizationAsync(
|
||||
AuthorizationFilterContext context,
|
||||
@@ -78,8 +80,7 @@ namespace xIds.Providers
|
||||
//
|
||||
// Retrieve the application provider from DI ...
|
||||
var applicationProvider = http.RequestServices
|
||||
.GetService(typeof(IXApplicationProvider))
|
||||
as IXApplicationProvider;
|
||||
.GetService<IXApplicationProvider>();
|
||||
if (applicationProvider.IsNull())
|
||||
{
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user