🆔
OAuth 2.1 and OpenID Connect for Java Developers
  • README
  • Setup
    • Requirements
    • Setup
  • Introduction
    • Introduction to OAuth and OpenID Connect
    • Sample Application Architecture
  • Intro Labs
    • Authorization Code Grant in Action
    • Practice Authorization Grant Flows
  • Hands-On Labs
    • Lab 1: The server side (resource server)
    • Lab 2: The client side
  • Best-Practices & Recommendations
    • Client-Side
    • Server-Side
Powered by GitBook
On this page
  • Architecture
  • Configuration
  • Project contents
  1. Introduction

Sample Application Architecture

PreviousIntroduction to OAuth and OpenID ConnectNextAuthorization Code Grant in Action

Last updated 2 years ago

Architecture

We will extend the existing two microservices to use federated authentication based on OAuth 2.1 and OpenID Connect (OIDC).

  • OpenID Connect (OIDC) Identity Provider: This is central identity provider for single sign on which holds all users with their credentials

  • OAuth2/OIDC Resource Server (product-initial): The backend microservice providing product data (the OAuth2/OIDC resource server)

  • OAuth2/OIDC Client (ui-initial): The frontend UI microservice consuming the products (the OAuth2/OIDC client)

Configuration

These microservices are configured to be reachable via the following URL addresses (Port 8080 is the default port in spring boot).

Service URLs:

Service
URL

OIDC Identity Provider

Client (UI)

Resource Server (Products API)

Project contents

After importing the project into your IDE you should see a project structure like in the following picture. Here the VS Code project is shown, it may look different in other IDE's.

The main contents for this workshop consist of the following directories:

  • intro-labs: In the sub-directory auth-code-in-action you find a demo application that illustrates the OAuth 2 authorization code grant flow in details. Here you can follow all the subsequent steps happening during this protocol flow variant. In the sub-directory oauth_grants you get instructions on how to try different OAuth 2 authorization grant flows yourself with different tools like postman, curl and httpie.

  • labs: In this directory you find the workshop lab parts.

    • initial: This will be the starting point to implement code as part of this workshop

      • product: This is the provided sample product server microservice

      • ui: This is the provided sample product ui client microservice

    • solution: This is the reference solution for this workshop (please do NOT look into this now)

      • product: This is the reference solution of a OAuth2/OIDC product server microservice

      • ui: This is the reference solution of a OAuth2/OIDC product ui client microservice

So let's start with implementing the server side: The API (resource server).

Info: You can find more information on building OAuth 2.0/OIDC secured microservices with spring in and in

Spring Boot Reference Documentation
Spring Security Reference Documentation
http://localhost:9000
http://localhost:9095/client
http://localhost:9090/server
Architecture
Project Structure