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
- java 21 installed
./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
-
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- oauth2-db --- MariaDB for storing Spring Authorization Server (registered clients, authorizations, consent screen)
- oauth2-session --- Redis DB for storing Spring Security Sessions
- UI available on http://localhost:8082
- 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