Expected Behavior

There should be a way to set the custom implementation for AuthenticationTrustResolver on ExceptionTranslationFilter via ExceptionHandlingConfigurer

Current Behavior

Cant set this up using the configurer. And the configurer class is also final so one cant extend it.

Context

wanted to set the custom AuthenticationTrustResolver so that a Access denied exception can be treated as a authentication exception to trigger the authentication flow.

Comment From: marcusdacoregio

Hi @nitsoni, have you tried using an ObjectPostProcessor? Something like:

http
    .exceptionHandling((exceptions) -> exceptions
        .withObjectPostProcessor(new ObjectPostProcessor<ExceptionTranslationFilter>() {
            @Override public<O extends ExceptionTranslationFilter> O postProcess(O object) {
                object.setAuthenticationTrustResolver(myAuthenticationTrustResolver);
                return object;
            }
        })
);

I don't think we want to add a method to the DSL to change the AuthenticationTrustResolver since it is pretty uncommon to do this.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.