readme.md
spring-auth-server-demo
It's a demo project for learning spring-auth-server.
This project consists of four sub-projects which described below.
How to run this demo?
Run with Docker (Postgres)
How to run this demo? Follows the steps below:
- Ensure Docker is running;
- Create the Docker storage
docker volume create idp_local
- Create DB instance in Docker
docker run -d --platform linux/amd64 -e POSTGRES_HOST_AUTH_METHOD=trust -v idp_local:/var/lib/postgresql/data --name postgres-idp-db -p 5432:5432 -d postgres:12-alpine
- Start the Auth. Server
cd .\auth-server-demo\ && mvn install && mvn spring-boot:run
- Start the IDP. Server
cd .\idp-server-demo\ && mvn install && mvn spring-boot:run
- Start the Resource Server
cd .\resource-server-demo\ && mvn install && mvn spring-boot:run
- Todo: start the angular
cd .\angular-client-demo\ && npm run start
Run without Docker (SQL Server Express)
Ensure the SQL Server (express) is running.
- Start the Auth. Server
cd .\auth-server-demo\ && mvn install && mvn spring-boot:run
- Start the IDP. Server
cd .\idp-server-demo\ && mvn install && mvn spring-boot:run
- Start the Resource Server
cd .\resource-server-demo\ && mvn install && mvn spring-boot:run
- Todo: start the angular
cd .\angular-client-demo\ && npm run start
Mapping table of ports
Port | Application |
---|---|
9000 | Auth. server |
8080 | IDP server |
8090 | Resource server |
TBD | Angular client |
auth-server-demo
Auth. server is a project built on Spring Authorization Server, which only focus on creating token and validating tokens.
This project embeds the learnings through the following documents:
- How-to: Implement core services with JPA This article adds the JPA implementations to client/authorization/authorization-consent
- How-to: Customize the OpenID Connect 1.0 UserInfo response
- Spring Security: Authentication - JDBC Authentication
- Spring Authorization Server Tutorial
- Add Roles to JWT Issued by Spring Authorization Server
- Role-based Access Control in Spring Authorization Server
- Spring Security: Authentication with a Database-backed UserDetailsService
- Password storage
- Spring Security Architecture
- Registration Login example using Spring Boot/Spring Security/JPA/MySql/Thymeleaf
- Spring Boot + Spring Security + Thymeleaf
To be read?
Dependencies:
- Java 17;
- Spring Boot 3.0;
- Spring Boot JPA;
- Spring Boot Web;
- Postgres 12;
- Spring Auth Server;
idp-server-demo
Identity Provider Server. This server will handle the user management, role assignment, etc.
Dependencies:
- Java 17;
- Spring Boot 3.0;
- Spring Boot JPA;
- Spring Boot Web;
- Postgres 12;
- Spring Security OAuth2 Client;
resource-server-demo
Resource server is a server which exposing the API for usages.
Dependencies:
- Java 17;
- Spring Boot 3.0;
- Spring Boot JPA;
- Spring Boot Web;
- Postgres 12;
- Resource Server;
angular-client-demo
An angular client which consume that resources.
Dependencies:
- Angular 14;
- Typescript 4.6.2;