Skip to content
Open
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
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,57 @@ npm run dev
- PostgreSQL runs on port 5432 (internal)


## Sequence Diagram of the Flow

```mermaid

sequenceDiagram
participant Browser as Frontend #40;React#41;
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTML entities are being used instead of regular parentheses. In Mermaid diagrams, you should use regular parentheses instead of HTML entities. Replace #40; with ( and #41; with ).

Copilot uses AI. Check for mistakes.
participant YARP as BFF/YARP Proxy
participant TokenHandler as Token Handler Middleware
participant Cache as Hybrid Cache
participant Keycloak as Keycloak #40;IdP#41;
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTML entities are being used instead of regular parentheses. In Mermaid diagrams, you should use regular parentheses instead of HTML entities. Replace #40; with ( and #41; with ).

Copilot uses AI. Check for mistakes.
participant API as Backend API

Note over Browser,API: Initial Authentication Flow

Browser->>YARP: 1. Access protected resource
YARP->>TokenHandler: 2. Check authentication
TokenHandler->>Browser: 3. Redirect to /Account/Login
Browser->>YARP: 4. GET /Account/Login
YARP->>Keycloak: 5. OIDC Authorization Request
Keycloak->>Browser: 6. Login page
Browser->>Keycloak: 7. Submit credentials
Keycloak->>YARP: 8. Authorization code #40;callback#41;
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTML entities are being used instead of regular parentheses. In Mermaid diagrams, you should use regular parentheses instead of HTML entities. Replace #40; with ( and #41; with ).

Copilot uses AI. Check for mistakes.

Note over YARP,Keycloak: Token Exchange
YARP->>Keycloak: 9. Exchange code for tokens<br/>#40;OnAuthorizationCodeReceived#41;
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTML entities are being used instead of regular parentheses. In Mermaid diagrams, you should use regular parentheses instead of HTML entities. Replace #40; with ( and #41; with ).

Copilot uses AI. Check for mistakes.
Keycloak->>YARP: 10. Access + Refresh tokens

Note over YARP,Cache: Token Storage
YARP->>Cache: 11. Store tokens with session-id<br/>#40;OnTokenValidated#41;
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTML entities are being used instead of regular parentheses. In Mermaid diagrams, you should use regular parentheses instead of HTML entities. Replace #40; with ( and #41; with ).

Copilot uses AI. Check for mistakes.
YARP->>Browser: 12. Set session-id cookie #40;HttpOnly, Secure#41;
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTML entities are being used instead of regular parentheses. In Mermaid diagrams, you should use regular parentheses instead of HTML entities. Replace #40; with ( and #41; with ).

Copilot uses AI. Check for mistakes.
YARP->>Browser: 13. Redirect to original URL

Note over Browser,API: Subsequent API Calls

Browser->>YARP: 14. API request with session-id cookie
YARP->>TokenHandler: 15. AuthenticationHeaderSubstitutionMiddleware
TokenHandler->>Cache: 16. Retrieve tokens by session-id
Cache->>TokenHandler: 17. Return OAuthTokenResponse
TokenHandler->>TokenHandler: 18. Add Authorization: Bearer {#35;access_token{#35;}
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTML entity {#35;} is being used instead of a regular hash symbol. In Mermaid diagrams, you should use # directly instead of HTML entities.

Suggested change
TokenHandler->>TokenHandler: 18. Add Authorization: Bearer {#35;access_token{#35;}
TokenHandler->>TokenHandler: 18. Add Authorization: Bearer #access_token#

Copilot uses AI. Check for mistakes.
TokenHandler->>API: 19. Proxied request with Bearer token
API->>API: 20. Validate JWT token
API->>TokenHandler: 21. API response
TokenHandler->>Browser: 22. Response #40;without tokens#41;
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTML entities are being used instead of regular parentheses. In Mermaid diagrams, you should use regular parentheses instead of HTML entities. Replace #40; with ( and #41; with ).

Copilot uses AI. Check for mistakes.

Note over Browser,API: Token Refresh #40;if needed#41;
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTML entities are being used instead of regular parentheses. In Mermaid diagrams, you should use regular parentheses instead of HTML entities. Replace #40; with ( and #41; with ).

Copilot uses AI. Check for mistakes.

Browser->>YARP: 23. API request #40;expired token#41;
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTML entities are being used instead of regular parentheses. In Mermaid diagrams, you should use regular parentheses instead of HTML entities. Replace #40; with ( and #41; with ).

Copilot uses AI. Check for mistakes.
TokenHandler->>Cache: 24. Get tokens
TokenHandler->>Keycloak: 25. Refresh token request
Keycloak->>TokenHandler: 26. New access token
TokenHandler->>Cache: 27. Update cached tokens
TokenHandler->>API: 28. Retry with new token

```