Spring Security's SecurityContext get unexpectedly cleared in a MockMvc TestBackground At work, there’s some test written where I wanted to query the database (repository) after mockMvc request has been made to verify the result. This is a very simple illustration of what it looks like. @SpringBootTest @AutoConfigureMockMvc ...Jun 14, 2025·3 min read·106
Maven 101 - BasicsIntroduction Maven is used to manage and build any Java-based project. It provides an opinionated way of the project structure, managing dependencies, building projects and deploying the artifacts. Project Object Model (POM) POM stands for Project Ob...Sep 16, 2023·11 min read·384
Spring Security: Configure debug mode programmaticallyIntroduction If you have used Spring Security before, you will likely enable the debug mode at some point @Configuration @EnableWebSecurity(debug = true) public class WebSecurityConfiguration { // omit } Start the application and you will see th...Jul 14, 2023·2 min read·365
Spring Security: Custom Pre-Authentication FlowIntroduction In one of my project setups, the authentication process is offloaded to Keycloak and set up with an Open Policy Agent sidecar in a typical Kubernetes deployment. Any request that comes to the service, will be pre-authenticated, and all c...Jul 9, 2023·12 min read·7.9K
Why RequestHeaderAuthenticationFilter is not registered as part of Spring Security Filter ChainBackground While I was writing for another blog post, I realize something interesting about RequestHeaderAuthenticationFilter where it isn't registered as part of the SecurityFilterChain. I thought this post should come first, to provide some sort of...Jun 7, 2023·9 min read·2.1K
Spring Boot Debezium (embedded) Engine with MongoDB as Source - Part 1I am exploring to use Debezium as my Change Data Capture tool to introduce it into my team/project. I wanted to keep it simple, hence I chose to go with the embedded engine. I wasn't able to find many examples of using MongoDB as a source database (e...Mar 12, 2023·7 min read·2.6K
Prefer Docker save and loadover Docker export and import. This serves as a reminder for me as I often mixed up myself. Save vs Export As per documentation, save produces a tar file that contains all parent layers, and all tags + versions, or specified repo:tag, for each argum...Feb 18, 2023·2 min read·416