Single Sign On (IDP) change log level of BadCredentialsException

Hi,
we use Signle-Sign-On in our cuba application with the idp-addon. When a user tries to login with a wrong password we get an ERROR log.

05:19:46.590 ERROR c.h.cuba.core.sys.ServiceInterceptor - Exception in IdpService.login(…): com.haulmont.cuba.security.global.BadCredentialsException: Unbekannter Login oder falsches Passwort: admin

I want change this log level to WARN. Is their any way to do this?

Thanks in advance!
Bye, Reini

The only way I see is to override the ServiceInterceptor bean in your IDP application:

  • Create a class extending ServiceInterceptor
  • Override its logException() method and handle the BadCredentialsException exception however you want
  • Register your class in spring.xml as serviceInterceptor bean:
      <bean id="serviceInterceptor" class="com.company.app.MyServiceInterceptor">
          <property name="userSessions" ref="cuba_UserSessions"/>
          <property name="persistence" ref="cuba_Persistence"/>
          <property name="statisticsAccumulator" ref="cuba_MiddlewareStatisticsAccumulator"/>
          <property name="configuration" ref="cuba_Configuration"/>
      </bean>
    

Regards,
Konstantin

1 Like