Class NtsExceptionTranslator

  • All Implemented Interfaces:
    org.springframework.security.web.server.authorization.ServerAccessDeniedHandler, org.springframework.security.web.server.ServerAuthenticationEntryPoint

    @ConditionalOnProperty(prefix="nts.web.rest.exception-translator",
                           name="enabled",
                           havingValue="true",
                           matchIfMissing=true)
    @ControllerAdvice
    @ConditionalOnMissingBean(name="exceptionTranslator")
    public class NtsExceptionTranslator
    extends ResponseEntityExceptionHandler
    implements org.springframework.security.web.server.ServerAuthenticationEntryPoint, org.springframework.security.web.server.authorization.ServerAccessDeniedHandler
    Controller advice to translate the server side exceptions to client-friendly json structures. The error response follows RFC7807 - Problem Details for HTTP APIs (RFC7807).
    • Field Detail

      • realmName

        @Value("${nts.web.rest.exception-translator.realm-name:API Authentication by nentangso.org}")
        protected String realmName
    • Constructor Detail

      • NtsExceptionTranslator

        public NtsExceptionTranslator()