-
Couldn't load subscription status.
- Fork 38.8k
Closed as not planned
Closed as not planned
Copy link
Labels
for: external-projectNeeds a fix in external projectNeeds a fix in external projectin: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid
Description
When a @PreAuthorize annotated method is called with insufficient permissions (anonymous call, missing authorities, missing roles), a AuthorizationDeniedException is thrown (like with Spring 6) but it is translated into HTTP 500 response.
With Spring 6 the response status is 401 or 403 with WWW-Authenticate header. Writing a @ExceptionHandler for this exception is possible but error prone.
When endpoints are secured by request matchers in the SecurityFilterChain configuration the status is 401 or 403 with WWW-Authenticate header.
Metadata
Metadata
Assignees
Labels
for: external-projectNeeds a fix in external projectNeeds a fix in external projectin: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid