This is a demo project to show how BFF Architecture works and authenticate user based on OAuth2/OIDC protocol.
- Java 17
- Spring Boot 3
- Spring Security
- Spring Boot Starter OAuth2 Client
- Spring Boot Starter OAuth2 Resource Server
- Spring Cloud Gateway
- Keycloak
- ReactJS
- Get the latest source code
- Add the following entry to your hosts file
127.0.0.1 backoffice
127.0.0.1 keycloak.local
127.0.0.1 pgadmin.local
- Open terminal of your choice, go to
bff-spring-keycloak-react-demo
directory, rundocker-compose up
, wait for all the containers up and running - Open another terminal, go to
backoffice
directory, runnpm install
andnpm run dev
to start the backoffice application - Open
bff-spring-keycloak-react-demo
project by your favorite IDE, openbackoffice-bff
to runBackofficeBffApplication.java
and openproduct
to runProductApplication.java
as Spring Boot Application - Open your browser, now you can access the websites via
http://backoffice/
login withadmin|123456
oruser|123456
http://keycloak.local/
to access Keycloak Admin Console, login withadmin|admin
http://pgadmin.local/
to access PgAdmin, login with[email protected]|admin
. Register a server: postgres, port 5432, username: admin, password: admin. The Postgresql server is also exposed to the host machine at port 5432.- Test Authentication Flow + PKCE with Swagger UI:
http://backoffice/api/product/swagger-ui/index.html
© 2023 HQT-Team
🤟 Feel free to use our repository and star it if you find something interesting 🤟