Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```