Linked Questions

Popular Questions

Spring MVC accessing Spring Security ConfigAttributes?

Asked by At

I want to produce HTTP Response Body with an error message referencing something like _"missing ... 'CUSTOM_AUTHORITY'"_ in addition to a 403 Forbidden HTTP Status code.

My application is Spring Boot with a Spring-Security-Secured @PreAuthorize method within a Spring-MVC-REST @Controller:


public FooController{
  public Object getSomething(){ ... }


public class GlobalExceptionHandler {
  public Object forbidden(AccessDeniedException exception){ ... }

What I want is to expose/inject Collection<ConfigAttribute>. The Spring Security docs reference it.

Related Questions