2 writes to Failure
Microsoft.AspNetCore.Authorization (2)
AuthorizationResult.cs (2)
16
private static readonly AuthorizationResult _failedResult = new() {
Failure
= AuthorizationFailure.ExplicitFail() };
42
public 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)
111
Assert.True(allowed.
Failure
.FailCalled);
189
Assert.NotNull(allowed.
Failure
);
190
Assert.Equal(2, allowed.
Failure
.FailureReasons.Count());
191
var first = allowed.
Failure
.FailureReasons.First();
194
var second = allowed.
Failure
.FailureReasons.Last();
218
Assert.IsType<ClaimsAuthorizationRequirement>(allowed.
Failure
.FailedRequirements.First());