// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; namespace Microsoft.AspNetCore.Authorization.Policy { /// /// Base class for authorization handlers that need to be called for a specific requirement type. /// public interface IPolicyEvaluator { /// /// Does authentication for and sets the resulting /// to . If no schemes are set, this is a no-op. /// /// The . /// The . /// unless all schemes specified by fail to authenticate. Task AuthenticateAsync(AuthorizationPolicy policy, HttpContext context); /// /// Attempts authorization for a policy using . /// /// The . /// The result of a call to . /// The . /// Returns if authorization succeeds. /// Otherwise returns if , otherwise /// returns Task AuthorizeAsync(AuthorizationPolicy policy, AuthenticateResult authenticationResult, HttpContext context); } }