piomin/sample-spring-security-microservices
Demo illustrating the usage of Spring Security in microservices built on top of Spring Boot and Spring Cloud
Example Project for Security in Spring Boot and Microservices 
In this project I'm demonstrating you the most interesting features of Spring Cloud Project for building microservice-based architecture.
I'm publishing on my blog and maintaining example repositories just as a hobby. But if you feel it's worth donating:
- How to renew certificates in your Spring Boot apps on Kubernetes with Cert Manager and Stakater Reloader. The example is available in the branch master. A detailed guide may be found in the following article: Renew Certificates on Kubernetes with Cert Manager and Reloader
- How to reload
SslBundleswith Spring Boot and run the apps on Kubernetes. A detailed guide may be found in the following article: Spring Boot SSL Hot Reload on Kubernetes - How to use OAuth2 with Spring Cloud and integrate Spring Boot app with Keycloak. A detailed guide may be found in the following article: Microservices with Spring Cloud Gateway, OAuth2 and Keycloak
- How to use SAML2 with Spring Boot and integrate it with Keycloak through the OpenSAML Shibboleth library. A detailed guide may be found in the following article: Spring Boot with SAML2 and Keycloak
Getting Started
SSL
To access an example with Spring Boot SSLBundle go to the ssl directory.
First, run the secure-callme-bundle app:
cd ssl/secure-callme-bundle
mvn spring-boot:runFirst, run the secure-caller-bundle app:
cd ssl/secure-caller-bundle
mvn spring-boot:runThen call the endpoint exposed by the with the curl command:
curl https://localhost:8444/caller/ping --insecureSAML2
To access an example with Spring Boot SAML 2.0 example go to the saml directory.
First, run the Keycloak container:
cd saml
docker compose upOnce the Keycloak is started go to callme-saml and run the app:
cd callme-saml
mvn spring-boot:runOAuth2
To access an example with Spring Boot OAuth2 example go to the oauth directory.
While building the gateway app it runs Testcontainer with Keycloak and simulates a downstream service:
cd oauth/gateway
mvn clean package