blog.broncotoxique.com

Juste another geek’s website

Tag: Spring

  • Spring-Framework, JavaMelody and MongoTemplate

    Let say you use Spring-Framework (without Spring-Boot), MongoTemplate and JavaMelody in the same app. I guess you will need to see the mongo request statistics in the Melody dashboard, like you see the SQL statistics. First you might have followed the JavaMelody documentation to setup Melody into you app. Let say you create your MongoTemplate…

  • Spring-Boot – Custom Actuator

    Let say you need a specific actuator for your Spring-Boot backend. This small post show you how to extend the interface HealthIndicator to create your custom actuator. First you’ll have implement the HealthIndicator interface: Now you will try to make your custom actuator load at the start of you application, here is the “auto-configuration” you…

  • Spring-Boot 3 – register an OIDC token provider

    Let say you have a Spring-Boot application and you need a token in order to authenticate/authorize a call made by your application targeting another app. Since Spring-Boot 3, and Spring 6, the spring-security packages handle the OIDC mechanism with built-in code. Also their is a common part in registration of OIDC provider used to authenticate/authorize…

  • Spring 6 – Oauthenticated http call

    Let’s say you have a Spring backend app, and you need to make some http(s) call from that backend to any web-service you want without configuring a global WebClient. Doing that you’ll face three possibly to authenticate your http call: – forward the token of the current user; – get a new token to authenticate…

  • Spring – BeanPostProcessor

    BeanPostProcessor is a factory hook that allows the Spring framework to customize and modify Bean instances when they are newly created. For example: by checking it’s marked interface or using a proxy to wrap it. The application context will automatically detect BeanPostProcessors from the Bean definition and apply them to any beans created subsequently. On…

  • Spring Boot 3 – multitenant OIDC with Keycloak

    Naturally Spring Security 3 allow you to do some kind of multi-tenant autentication, but you can’t use more than one OIDC tenant. Let say you are building a Spring Boot App with Spring-Boot 3.x.x and you use Keycloak as OpenID Connect provider, ans you need to validate some tokens from more than one OIDC tenant.…