1 write to AuthorizationFailure
Microsoft.AspNetCore.Authorization.Policy (1)
PolicyAuthorizationResult.cs (1)
57
: new PolicyAuthorizationResult { Forbidden = true,
AuthorizationFailure
= authorizationFailure };
7 references to AuthorizationFailure
CustomAuthorizationFailureResponse (5)
Authorization\SampleAuthorizationMiddlewareResultHandler.cs (5)
32
if (policyAuthorizationResult.Forbidden && policyAuthorizationResult.
AuthorizationFailure
!= null)
34
if (policyAuthorizationResult.
AuthorizationFailure
.FailureReasons.Any())
36
await httpContext.Response.WriteAsync(policyAuthorizationResult.
AuthorizationFailure
.FailureReasons.First().Message);
43
if (policyAuthorizationResult.
AuthorizationFailure
.FailedRequirements.Any(requirement => requirement is SampleRequirement))
51
else if (policyAuthorizationResult.
AuthorizationFailure
.FailedRequirements.Any(requirement => requirement is SampleWithCustomMessageRequirement))
Microsoft.AspNetCore.Authorization.Test (2)
PolicyEvaluatorTests.cs (2)
155
Assert.NotNull(result.
AuthorizationFailure
);
156
Assert.Contains(result.
AuthorizationFailure
.FailedRequirements, requirement => requirement is DummyRequirement);