Returns the status, title and detail of a standard authorization refusal —
the ONE owner of those values.
respondWithAuthorizationFailure writes it, and an error thrown
from a handler brands itself with it (through withHttpStatusHint), so a
guard's refusal and a thrown refusal answer the same body under the
application's configured error format.
The insufficient-privileges detail is deliberately fixed text: naming the
role, permission or policy a caller lacks tells an unauthorized caller what
to acquire. The second-factor-required detail says only what the caller
must do, not which factor or which policy produced the refusal.
Returns the status, title and detail of a standard authorization refusal — the ONE owner of those values.
respondWithAuthorizationFailurewrites it, and an error thrown from a handler brands itself with it (throughwithHttpStatusHint), so a guard's refusal and a thrown refusal answer the same body under the application's configured error format.The
insufficient-privilegesdetail is deliberately fixed text: naming the role, permission or policy a caller lacks tells an unauthorized caller what to acquire. Thesecond-factor-requireddetail says only what the caller must do, not which factor or which policy produced the refusal.