11-08-2019 8:51 PM - edited 02-03-2024 5:15 PM
We are using hybris 6.0 version.. There is a requirement to capture the logs whenever there is a invalid access happened to hmc/backoffice... Now we are getting the error only in hmc/backoffice login page. We need that to be logged in the console log.. Can you please tell us how to do this one?
Hi Ranjithraja,
We would have to customize the spring security form by adding a AuthenticationFaliureHandler.
Implement a new loginAuthenticationFaliureHandler by extending SimpleUrlAuthenticationFailureHandler, and overriding method onAuthenticationFailure(), to log what ever you want to log, in case you want to just log what spring security logs, I think you should be able to get it done just by enabling the logs for org.springframework.security.web.authentication package
<form-login
always-use-default-target="false"
login-page="/login.jsp"
authentication-failure-handler-ref="loginAuthenticationFailureHandler"
authentication-failure-url="/login.jsp?login_error=1"
username-parameter="j_username"
password-parameter="j_password"
login-processing-url="/j_spring_security_check"
/>
<bean id="loginAuthenticationFailureHandler" class="com.apple.ist.sap.asb2b.storefront.security.LoginAuthenticationFailureHandler" />
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.