Skip to content

Demo illustrating the usage of Spring Security in microservices built on top of Spring Boot and Spring Cloud

Notifications You must be signed in to change notification settings

piomin/sample-spring-security-microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example Project for Security in Spring Boot and Microservices Twitter

CircleCI

SonarCloud Bugs Coverage Lines of Code

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:

ko-fi

  1. 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
  2. How to reload SslBundles with 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
  3. 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
  4. 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:run

First, run the secure-caller-bundle app:

cd ssl/secure-caller-bundle
mvn spring-boot:run

Then call the endpoint exposed by the with the curl command:

curl https://localhost:8444/caller/ping --insecure

SAML2

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 up

Once the Keycloak is started go to callme-saml and run the app:

cd callme-saml
mvn spring-boot:run

OAuth2

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

About

Demo illustrating the usage of Spring Security in microservices built on top of Spring Boot and Spring Cloud

Topics

Resources

Stars

Watchers

Forks