This project runs 3 servers:
- Authorization Server (Documentation)
- Resource Server
- Client Application
sequenceDiagram
autonumber
actor user
participant client-app
participant authorization-server
participant resource-server
rect rgb(135, 150, 90)
Note right of user: Getting the Access Token
user ->> client-app: Click login link
client-app ->> client-app: create code_verifier
client-app ->> authorization-server: redirect to /authorize endpoint
authorization-server ->> user: redirect to user login
user ->> authorization-server: login and consent
authorization-server ->> client-app: send authorization code to callback URL
client-app ->> authorization-server: authorization code + code verifier to /token endpoint
authorization-server ->> authorization-server: validate code verifier and challenge
authorization-server ->> client-app: send id token + access token
end
rect rgb(55, 155, 0)
Note right of client-app: Requesting Data
client-app ->> resource-server: request data with access token
resource-server ->> client-app: response with data
end
sequenceDiagram
autonumber
participant client-app
participant authorization-server
participant resource-server
rect rgb(135, 150, 90)
Note right of client-app: Getting the Access Token
client-app ->> authorization-server: authenticate with client-id + client-secret to /token endpoint
authorization-server ->> authorization-server: validate client-id + client-secret
authorization-server ->> client-app: send access token
end
rect rgb(55, 155, 0)
Note right of client-app: Requesting Data
client-app ->> resource-server: request data with access token
resource-server ->> client-app: response with data
end
Running the Resource Server and the Client Application requires a running Authorization Server.
Run the Script start-apps.sh to start all 3 servers.
docker run -d -p 5000:5000 --restart=always --name registry registry:2
mvn clean install -Dacr.publish=false -Dartifacts.server=localhost:5000This will tag the images with localhost:5000 as docker registry.
See: https://developer.okta.com/blog/2022/06/17/simple-crud-react-and-spring-boot