🔄
Spring Cloud Gateway Workshop
  • README
  • Introduction
    • Prerequisites
    • Requirements and Setup
    • Introduction to Spring Cloud Gateway
    • Sample Application Architecture
    • Provided Backend Microservices
  • Intro Lab
    • Reactive Streams with Spring Reactor in Action
  • Hands-On Labs
    • Lab 1: Routing - Configure & Monitor Gateway Routes
    • Lab 2: Resilience - Retry, Circuit Breaking and Rate Limiting
    • Lab 3: Security Part 1 - Authentication with JWT
    • Lab 4: Security Part 2 - Secure Communication with TLS
  • Next Steps
    • Further Gateway Features
Powered by GitBook
On this page
  • Import the workshop project into your IDE
  • Run the java applications
  • Spring Authorization Server
  • Check Running Server
  • Docker and docker compose
  • mkcert - Create a local Certificate Authority (CA)
  1. Introduction

Requirements and Setup

PreviousPrerequisitesNextIntroduction to Spring Cloud Gateway

Last updated 1 year ago

Import the workshop project into your IDE

  1. Clone the git repository https://github.com/andifalk/spring-cloud-gateway-workshop or download it as zip file

  2. Import the whole directory into your Java IDE as Maven project

    • IntelliJ: File/New/Project from existing sources -> Select directory -> Select Maven in next step

    • Eclipse: File/Import -> Select 'Maven'/'Existing Maven Projects' -> Select directory -> Click 'Finish'

    • Visual Studio Code: Just open the directory with VS Code -> VS Code should automatically configure the project

  3. You might have to explicitly trigger an update for the maven configuration to load dependencies (depending on your IDE)

Run the java applications

All spring boot based java projects can either be run using your Java IDE or using the command line with changing into the corresponding project directory and issuing a ./gradlew bootRun command.

Spring Authorization Server

In this workshop we will use a customized version of as local identity provider. implements OAuth 2.0 and OpenID Connect 1.0.

This version contains pre-configured users and registered OAuth/OIDC clients that we will use for both, the provided sample backend applications (customer and product APIs) and the Spring Cloud Gateway we will implement as part of this workshop.

To set up and run the customized Spring Authorizationserver:

  1. Clone or download the GitHub repository at:

  2. Import this project into your IDE as a gradle project

  3. After the IDE has configured the project you can start the authorization server by running the main class com.example.spring.authorizationserver.SpringAuthorizationServerApplication

Check Running Server

If you can see the openid configuration in the browser (how nice it is shown depends on your browser addons) then spring authorization server is ready for use in this workshop.

You can use the following users to log into the custom Spring Authorization Server:

User / Password
Role(s)

bwayne / wayne

USER

pparker / parker

USER, ADMIN

ckent / kent

USER

Docker and docker compose

If you want to follow configuring a rate limiter as part of hands-on lab 2 you will need to run a container image with a redis database. Therefore a container runtime is required.

mkcert - Create a local Certificate Authority (CA)

The spring authorization server runs on port 9000. To validate that it is running as expected, please open the web browser and navigate to the .

If you don't have already docker installed on your machine please open the corresponding location and follow instructions there. With Docker Desktop you already have docker compose installed. Other installations like standalone engine on Linux require an additional .

In case you have installed another container runtime like this should also work, as long as docker compose is supported by that solution.

is a helpful tool to create a local CA for Lab 4 to configure TLS/SSL for the api gateway. Please follow the section on how to install this on your local machine.

Spring Authorization Server
Spring Authorization Server
https://github.com/andifalk/custom-spring-authorization-server
OpenID Connect discovery endpoint
docker installation
installation of docker compose
Rancher Desktop
mkcert
mkcert installation
Openid Configuration