graph LR
subgraph Relying Party (RP) / Client
A[User's Browser] --> B{Initiate Authentication};
B --> C[Redirect to IdP];
end
subgraph Identity Provider (IdP) / Authorization Server
C --> D[User Authentication (Login)];
D --> E{Authorization Grant};
E --> F[Issue ID Token & Access Token];
F --> G[Redirect back to RP with Tokens];
end
subgraph RP (continued)
G --> H{Validate ID Token};
H --> I{Access User Information};
I --> J[Establish Session];
J --> K[Access Protected Resources];
end
style A fill:#f9f,stroke:#333,stroke-width:2px
style B fill:#ccf,stroke:#333,stroke-width:2px
style C fill:#ccf,stroke:#333,stroke-width:2px
style D fill:#f9f,stroke:#333,stroke-width:2px
style E fill:#ccf,stroke:#333,stroke-width:2px
style F fill:#ccf,stroke:#333,stroke-width:2px
style G fill:#ccf,stroke:#333,stroke-width:2px
style H fill:#ccf,stroke:#333,stroke-width:2px
style I fill:#ccf,stroke:#333,stroke-width:2px
style J fill:#ccf,stroke:#333,stroke-width:2px
style K fill:#ccf,stroke:#333,stroke-width:2px
linkStyle 0,3,6 { stroke-width: 2px; stroke: #000; }
linkStyle 1,2,4,5 { stroke-width: 2px; stroke: #000; }
linkStyle 7,8,9 { stroke-width: 2px; stroke: #000; }
classDef boxFill fill:#ccf,stroke:#333,stroke-width:2px
class A,D boxFill;
subgraph Interaction
direction LR
L[RP initiates authentication request] --> R[IdP authenticates user and issues tokens]
R --> L2[RP validates the ID token and grants access]
end
Key improvements and explanations:
- Clearer Subgraphs: Subgraphs for "Relying Party" and "Identity Provider" neatly group the steps and make the diagram easier to follow. The "Interaction" subgraph summarizes the overall flow.
- Relying Party split: RP is shown in two parts, this avoids lines overlapping.
- Explicit Steps: Each step (A through K) is clearly labeled, describing the action performed. This makes it much more informative. Using descriptive labels like "Initiate Authentication" and "Validate ID Token" is far better than just letters.
- User's Browser Representation: Includes the user's browser as the starting point, which is crucial for understanding the overall flow.
- ID Token & Access Token: Clearly indicates that both ID Token and Access Token are issued. This is a core concept of OIDC.
- Validation Step: Emphasizes the crucial ID Token validation step on the RP side. This is a critical security measure.
- Establish Session: Adds the step of establishing a session at the RP after successful authentication. This is what keeps the user logged in.
- Protected Resources: Adds the step of accessing protected resources.
- Styling: Uses
style and classDef commands for better visual clarity. Specifically, it highlights the "User Authentication" and "User's Browser" states with a different fill color (#f9f) to indicate user interaction.
- Link Styles: Uses
linkStyle to define the appearance of the connections, making the diagram more readable.
- Concise Description: Focuses on the essential steps of the OIDC flow.
- Interaction subgraph: Added to summarize interaction.
This improved version provides a much more comprehensive and understandable illustration of the OIDC Single Sign-On process. It highlights the key components and interactions, making it useful for explaining the flow.