It would be nice if we supported AuthrozationDecision return types for Method Security SpEL. This would allow method security to easily convey more information to the framework on why authorization failed (e.g. requires MFA). For example:
@Service
class Authz {
AuthorizationDecision check(...) {
// ...
}
}
@PreAuthorize("@authz.check(...)")