<mxfile host="app.diagrams.net"><diagram name="OpenID Connect + OAuth 2.0 – authorization code flow with PKCE" id="d1"><mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1200" pageHeight="1100" background="#FFFFFF" math="0" shadow="0"><root><mxCell id="0" /><mxCell id="1" parent="0" /><mxCell id="c2" value="" style="html=1;rounded=0;endArrow=none;endFill=1;startArrow=none;startFill=1;strokeColor=#A19F9D;strokeWidth=1.2;dashed=1;dashPattern=6 4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="60.0" y="912.0" as="sourcePoint" /><mxPoint x="1140.0" y="912.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c3" value="" style="html=1;rounded=0;endArrow=none;endFill=1;startArrow=none;startFill=1;strokeColor=#A19F9D;strokeWidth=1.2;dashed=1;dashPattern=6 4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1000.0" y="158.0" as="sourcePoint" /><mxPoint x="1000.0" y="1065.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c4" value="" style="html=1;rounded=0;endArrow=none;endFill=1;startArrow=none;startFill=1;strokeColor=#A19F9D;strokeWidth=1.2;dashed=1;dashPattern=6 4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="600.0" y="158.0" as="sourcePoint" /><mxPoint x="600.0" y="1065.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c5" value="" style="html=1;rounded=0;endArrow=none;endFill=1;startArrow=none;startFill=1;strokeColor=#A19F9D;strokeWidth=1.2;dashed=1;dashPattern=6 4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="200.0" y="158.0" as="sourcePoint" /><mxPoint x="200.0" y="1065.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c6" value="&lt;b&gt;OpenID Connect + OAuth 2.0 – authorization code flow with PKCE&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;fontSize=22;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="40.0" y="18.0" width="1120.0" height="30.0" as="geometry" /></mxCell><mxCell id="c7" value="&lt;span style=&quot;font-size:13.5px;color:#605E5C&quot;&gt;One sign-in, three tokens – and an API that never calls the identity provider&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;fontSize=15;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="40.0" y="50.0" width="1120.0" height="22.0" as="geometry" /></mxCell><mxCell id="c8" value="" style="html=1;rounded=0;endArrow=none;endFill=1;startArrow=none;startFill=1;strokeColor=#0078D4;strokeWidth=2;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="40.0" y="82.0" as="sourcePoint" /><mxPoint x="1160.0" y="82.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c9" value="&lt;b&gt;Client app&lt;/b&gt;&lt;br&gt;&lt;span style=&quot;font-size:12.5px;color:#605E5C&quot;&gt;browser / SPA + MSAL&lt;/span&gt;" style="rounded=1;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=16;fillColor=#F3F2F1;strokeColor=#8A8886;strokeWidth=1.5;fontColor=#323130;fontSize=14;fontFamily=Helvetica;align=center;verticalAlign=middle;spacingLeft=12;spacingRight=12;spacingTop=0;" vertex="1" parent="1"><mxGeometry x="70.0" y="100.0" width="260.0" height="58.0" as="geometry" /></mxCell><mxCell id="c10" value="&lt;b&gt;Microsoft Entra ID&lt;/b&gt;&lt;br&gt;&lt;span style=&quot;font-size:12.5px;color:#605E5C&quot;&gt;authorization server&lt;/span&gt;" style="rounded=1;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=16;fillColor=#DEECF9;strokeColor=#0078D4;strokeWidth=1.5;fontColor=#323130;fontSize=14;fontFamily=Helvetica;align=center;verticalAlign=middle;spacingLeft=12;spacingRight=12;spacingTop=0;" vertex="1" parent="1"><mxGeometry x="470.0" y="100.0" width="260.0" height="58.0" as="geometry" /></mxCell><mxCell id="c11" value="&lt;b&gt;Web API&lt;/b&gt;&lt;br&gt;&lt;span style=&quot;font-size:12.5px;color:#605E5C&quot;&gt;resource server&lt;/span&gt;" style="rounded=1;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=16;fillColor=#DFF6DD;strokeColor=#107C10;strokeWidth=1.5;fontColor=#323130;fontSize=14;fontFamily=Helvetica;align=center;verticalAlign=middle;spacingLeft=12;spacingRight=12;spacingTop=0;" vertex="1" parent="1"><mxGeometry x="870.0" y="100.0" width="260.0" height="58.0" as="geometry" /></mxCell><mxCell id="c12" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="200.0" y="215.0" as="sourcePoint" /><mxPoint x="998.0" y="215.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c13" value="1" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="210.0" y="203.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c14" value="GET /api/orders&amp;nbsp;  (no token)" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="495.0" y="183.8" width="210.0" height="21.2" as="geometry" /></mxCell><mxCell id="c15" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1000.0" y="275.0" as="sourcePoint" /><mxPoint x="202.0" y="275.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c16" value="2" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="966.0" y="263.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c17" value="401 Unauthorized" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="537.0" y="243.8" width="126.0" height="21.2" as="geometry" /></mxCell><mxCell id="c18" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="200.0" y="350.0" as="sourcePoint" /><mxPoint x="598.0" y="350.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c19" value="3" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="210.0" y="338.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c20" value="GET /authorize&lt;br&gt;&lt;span style=&quot;font-size:11.0px;color:#605E5C&quot;&gt;scopes + PKCE code_challenge&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="306.8" y="303.6" width="186.5" height="36.4" as="geometry" /></mxCell><mxCell id="c21" value="Sign-in: password, MFA, passkey…&lt;br&gt;+ Conditional Access evaluation" style="rounded=1;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=16;fillColor=#FFF4CE;strokeColor=#986F0B;strokeWidth=1.5;fontColor=#323130;fontSize=12;fontFamily=Helvetica;align=center;verticalAlign=middle;spacingLeft=12;spacingRight=12;spacingTop=0;" vertex="1" parent="1"><mxGeometry x="445.0" y="372.0" width="310.0" height="56.0" as="geometry" /></mxCell><mxCell id="c22" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="600.0" y="495.0" as="sourcePoint" /><mxPoint x="202.0" y="495.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c23" value="4" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="566.0" y="483.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c24" value="302 → redirect_uri?code=…&lt;br&gt;&lt;span style=&quot;font-size:11.0px;color:#605E5C&quot;&gt;authorization code: short-lived, single use&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="260.6" y="448.6" width="278.9" height="36.4" as="geometry" /></mxCell><mxCell id="c25" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="200.0" y="575.0" as="sourcePoint" /><mxPoint x="598.0" y="575.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c26" value="5" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="210.0" y="563.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c27" value="POST /token&lt;br&gt;&lt;span style=&quot;font-size:11.0px;color:#605E5C&quot;&gt;code + code_verifier&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="331.4" y="528.6" width="137.2" height="36.4" as="geometry" /></mxCell><mxCell id="c28" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="600.0" y="665.0" as="sourcePoint" /><mxPoint x="202.0" y="665.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c29" value="6" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="566.0" y="653.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c30" value="&lt;b&gt;ID token + access token + refresh token&lt;/b&gt;&lt;br&gt;&lt;span style=&quot;font-size:11.0px;color:#605E5C&quot;&gt;ID token (who) · access token (API) · refresh token (renew)&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="212.0" y="618.6" width="376.0" height="36.4" as="geometry" /></mxCell><mxCell id="c31" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="200.0" y="750.0" as="sourcePoint" /><mxPoint x="998.0" y="750.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c32" value="7" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="210.0" y="738.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c33" value="GET /api/orders&lt;br&gt;&lt;span style=&quot;font-size:11.0px&quot;&gt;&lt;font face=&quot;Courier New&quot;&gt;Authorization: Bearer eyJ0eXAiOiJKV1Qi…&lt;/font&gt;&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="462.2" y="703.6" width="275.7" height="36.4" as="geometry" /></mxCell><mxCell id="c34" value="Validates the JWT locally&lt;br&gt;signature · iss · aud · exp" style="rounded=1;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=16;fillColor=#FFF4CE;strokeColor=#986F0B;strokeWidth=1.5;fontColor=#323130;fontSize=12;fontFamily=Helvetica;align=center;verticalAlign=middle;spacingLeft=12;spacingRight=12;spacingTop=0;" vertex="1" parent="1"><mxGeometry x="850.0" y="772.0" width="300.0" height="54.0" as="geometry" /></mxCell><mxCell id="c35" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1000.0" y="870.0" as="sourcePoint" /><mxPoint x="202.0" y="870.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c36" value="8" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="966.0" y="858.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c37" value="200 OK" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="572.0" y="838.8" width="56.0" height="21.2" as="geometry" /></mxCell><mxCell id="c38" value="&lt;span style=&quot;font-size:11.5px;color:#605E5C&quot;&gt;… later, when the access token expires (silently, via MSAL) …&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=13;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="370.0" y="900.0" width="460.0" height="24.0" as="geometry" /></mxCell><mxCell id="c39" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="200.0" y="980.0" as="sourcePoint" /><mxPoint x="598.0" y="980.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c40" value="9" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="210.0" y="968.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c41" value="POST /token&lt;br&gt;&lt;span style=&quot;font-size:11.0px&quot;&gt;&lt;font face=&quot;Courier New&quot;&gt;grant_type=refresh_token&lt;/font&gt;&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="312.5" y="933.6" width="175.0" height="36.4" as="geometry" /></mxCell><mxCell id="c42" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="600.0" y="1050.0" as="sourcePoint" /><mxPoint x="202.0" y="1050.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c43" value="10" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="566.0" y="1038.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c44" value="new access token + new refresh token&lt;br&gt;&lt;span style=&quot;font-size:11.0px;color:#605E5C&quot;&gt;re-evaluation: user disabled? sessions revoked? CA policies?&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="212.0" y="1003.6" width="376.0" height="36.4" as="geometry" /></mxCell></root></mxGraphModel></diagram></mxfile>