Skip to content

GoodbyePlanet/spring-cg-bff

Repository files navigation

Spring authorization server with Spring Cloud Gateway as a BFF

Contains implementation of Backend-for-Frontend (BFF) pattern for browser-based applications using Spring Authorization Server and Spring Cloud Gateway. Additionally, it includes passkeys-service for WebAuthn passwordless authentication and leaked-passwords-api for checking if user passwords have been compromised.

Implementation of BFF pattern for browser-based applications

Prerequisites

  • java 21 installed

To start all services

./build-and-run.sh

This will build all backend modules, create and run docker containers

If you would like to build and run fe-client

cd fe-client
cp .env.example .env.development
nvm use
yarn
yarn dev

Services

  • auth-server --- Spring Authorization Server

  • gateway --- Spring Cloud Gateway service acting as a BFF (Backend for Frontend)

  • secure-resource --- Spring Resource Server

  • fe-client --- React frontend application

  • leaked-passwords-api - Service for checking if the user password is leaked

    • To start this service cloned it from this Github repo.
    • Then:
cd leaked-passwords-api
docker build -t leaked-passwords-api .
docker run -e GIN_MODE=release -e APP_ENV=development -p 8083:8083 --network spring-cg-bff_default --name leaked-passwords-api leaked-passwords-api
  • passkeys-service - Service for WebAuthn passwordless authentication
    • To start this service cloned it from this Github repo.
    • Then:
cd passkey-service
make docker-build
make up
docker network connect spring-cg-bff_default passkeys-service # connect to network of apps started by docker-compose from this repository

Databases

Observability

  • To start docker containers related to observability
cd observability
docker-compose up

Grafana UI is present on http://localhost:3000/ Loki is at http://loki:3100

About

OAuth 2.0 - Implementation of BFF pattern for browser-based applications (https://www.ietf.org/archive/id/draft-ietf-oauth-browser-based-apps-15.html#name-backend-for-frontend-bff)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors