From 65e173aa85250d819d2e5022f7690d1e3788d1a0 Mon Sep 17 00:00:00 2001 From: abroa01 <142853163+abroa01@users.noreply.github.com> Date: Sat, 2 Nov 2024 16:08:13 -0400 Subject: [PATCH] Update README.md Adding a sequence diagram that includes high level understanding of the flow --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index bde5d95..4b71eff 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,34 @@ This starts a webserver on localhost, allows someone to connect, then connects t * https://docs.webchartnow.com/resources/system-specifications/fhir-application-programming-interface-api/oauth-2.0-tutorial/ * https://docs.enterprisehealth.com/resources/system-specifications/fhir-application-programming-interface-api/oauth-2.0-tutorial/ + + +## Sequence Diagram + +```mermaid +sequenceDiagram + actor U as User + participant N as Node.js Server + participant O as OAuth2 Server (.well-known) + + U ->> N: Access Node.js server + N ->> O: Request OpenID configuration (.well-known/openid-configuration) + O -->> N: Return configuration (auth & token endpoints) + + N ->> O: Generate login link using authorization endpoint + O -->> N: Send login link back + N ->> U: Show login link to user + + U ->> O: User clicks login link (Authorization URL) + O ->> U: Prompt User for Authentication + U -->> O: User Authenticates + + O ->> U: Redirect to Node.js Server with Authorization Code + U ->> N: Send Authorization Code to Node.js Server + + N ->> O: Exchange Authorization Code for Access Token + O -->> N: Return Access Token + + N ->> U: Respond with Access Token or Success Message + +```