-
You can find all the code shown in this tutorial on GitHub in the @oktadev/auth0-java-microservices-examples repository. The OpenFeign example with Spring MVC is in the spring-boot-gateway-mvc directory. The Spring Cloud Gateway with WebFlux is in spring-boot-gateway-webflux. The Keycloak example is in the keycloak branch.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
At startup, these properties will be read using spring-dotenv.
-
JHipster
JHipster, much like Spring initializr, is a generator to create a boilerplate backend application, but also with an integrated front end implementation in React, Vue or Angular. In their own words, it "Is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures."
An easy way to get a pre-configured Keycloak instance is to use JHipster's jhipster-sample-app-oauth2 application. It gets updated with every JHipster release. You can clone it with the following command:
-
Okta also now has an Okta Spring Boot starter. I didn't use it in my first experiment, but I'm a big fan of it after the last few years! It dramatically simplifies configuration and makes securing your apps with OAuth 2.0 and OIDC easy. It's a thin wrapper around Spring Security's resource server, OAuth client, and OIDC features. Not only that, but it works with Okta Workforce Identity, Okta Customer Identity (aka Auth0), and even Keycloak.
-
I created all of these applications using start.spring.io's REST API and HTTPie.
-
spring-cloud-gateway
An API Gateway built on Spring Framework and Spring Boot providing routing and more.
Spring Cloud Gateway MVC 2023.0.0 doesn't allow you to configure a TokenRelay filter in YAML, so I added a RouterFunction bean to add it.
-
To run the example, you must install the Auth0 CLI and create an Auth0 account. If you don't have an Auth0 account, sign up for free. I recommend using SDKMAN! to install Java 17+ and HTTPie for making HTTP requests.
-
jhipster-sample-app-oauth2
This is a sample application created with JHipster, with the OAuth2 option
git clone https://github.com/jhipster/jhipster-sample-app-oauth2.git --depth=1 cd jhipster-sample-app-oauth2
-
You can see the access token's contents by copying/pasting it into jwt.io. You can also access the car service directly using it.
-
auth0-jhipster-k8s-eks-microservices-example
A microservice sample application configured to use Auth0 for OIDC and Terraform scripts to deploy to AWS EKS
Deploy Secure Spring Boot Microservices on Amazon EKS Using Terraform and Kubernetes
-
Build a Beautiful CRUD App with Spring Boot and Angular