Implement IAuthorizationMiddlewareResultHandler, wrap the default AuthorizationMiddlewareResultHandler, and when authorizeResult.Forbidden is true inspect AuthorizationFailure.FailureReasons. Map each known reason to a stable ProblemDetails: Status = 403, a documented type URI (for example https://errors.example.com.au/tenant-suspended), a short title ("Subscription suspended") and a user-friendly detail that tells the user what to do, plus the traceId. Write it with IProblemDetailsService so it matches your other errors. Log the full reason server-side (requirement, policy, user and tenant ids) and keep the client message coarse, so you help legitimate users without telling an attacker which rule to get around. Unknown reasons get a generic 403 problem; 401 challenges stay on the default path so cookie redirects and WWW-Authenticate headers still work.
Checks they know IAuthorizationMiddlewareResultHandler and avoid leaking internal detail
Last updated 23 Nov 2026.