Skip to content
Advertisement

Tag: spring-security

Spring actuator ‘/auditevents’ endpoint returns 404

I am getting a 404 error when invoking /actuator/auditevents endpoint. Upon closer look, I see that available endpoint listing doesn’t include /auditevents endpoint. pom.xml dependencies application.properties management.endpoints.web.exposure.include=* http://localhost:8080/actuator output Spring-boot version: 2.2.6.RELEASE Not sure whether I am missing any required configuration. Answer Auditing can be enabled by providing a bean of type AuditEventRepository in your application’s configuration. Try to add

Use multiple HttpSessionIdResolver with Spring

I want to use the HTTPSessionIdResolver for everything located under “/api**” and for everything else the standard CookieResolver. How is this possible, so that the two configurations use different resolvers? With my current approach everything uses X-AUTH. I tried to understand the implementation within Spring and I end up in the SessionRepositoryFilter, but of this filter only one instance is

Adding Same Site Header to JSESSIONID Spring Security

Google chrome has introduced changes that require setting the Same-Site header. In order to achieve this, I added a custom filter as follows, Following is the code for Security Configuration However, when I look at the headers received, I get this The filter adds the required fields in all the responses exception the one containing the JSESSIONID cookie. How do

How to handle UsernameNotFoundException spring security

How to handle UsernameNotFoundException ? In spring security when username not found the UserDetailsService implementation throws a UsernameNotFoundException. For example like this: I would like to build a custom “User not found REST response”. How should I catch/handle this exception? I have implemented a handler method in the WebSecurityConfigurerAdapter implementation the handler: But this method should wait for an AuthenticationException

Advertisement