2 writes to Failure
Microsoft.AspNetCore.Authorization (2)
AuthorizationResult.cs (2)
16private static readonly AuthorizationResult _failedResult = new() { Failure = AuthorizationFailure.ExplicitFail() }; 42public static AuthorizationResult Failed(AuthorizationFailure failure) => new AuthorizationResult { Failure = failure };
10 references to Failure
Aspire.Dashboard (1)
Authentication\AspirePolicyEvaluator.cs (1)
122? PolicyAuthorizationResult.Forbid(result.Failure)
Microsoft.AspNetCore.Authorization (2)
AuthorizationResult.cs (1)
23[MemberNotNullWhen(false, nameof(Failure))]
DefaultAuthorizationService.cs (1)
84_logger.UserAuthorizationFailed(result.Failure);
Microsoft.AspNetCore.Authorization.Policy (1)
PolicyEvaluator.cs (1)
106? PolicyAuthorizationResult.Forbid(result.Failure)
Microsoft.AspNetCore.Authorization.Test (6)
DefaultAuthorizationServiceTests.cs (6)
111Assert.True(allowed.Failure.FailCalled); 189Assert.NotNull(allowed.Failure); 190Assert.Equal(2, allowed.Failure.FailureReasons.Count()); 191var first = allowed.Failure.FailureReasons.First(); 194var second = allowed.Failure.FailureReasons.Last(); 218Assert.IsType<ClaimsAuthorizationRequirement>(allowed.Failure.FailedRequirements.First());