Skip to content

Commit 468e247

Browse files
committed
Add explanations of the different steps
1 parent d742b5a commit 468e247

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

index.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,39 @@
1616
</div>
1717
<div>Enable cors (*) + pkce (s254) + redirect URI (http://localhost:8000/)</div>
1818
<textarea id="result" readonly rows="20" style="width: 80%;"></textarea>
19+
20+
<div>
21+
<ol>
22+
<li>The user clicks the login button;</li>
23+
<li>The frontend navigates to the auth URL, which contains:
24+
<ul>
25+
<li>response_type=code // this is the <b>code</b> flow</li>
26+
<li>client_id=schweizmobil-website // this is provided by the SSO</li>
27+
<li>redirect_uri=http://localhost:8000& // this an <b>exact</b> URL that must match the one configured in the SSO</li>
28+
<li>scope=openid+roles // are the scopes that should be present in the generated token</li>
29+
<li>state=xx nonce=xx code_challenge=xx code_challenge_method=S256 // these are for security of the protocol and handled automatically</li>
30+
</ul>
31+
</li>
32+
<li>The SSO displays the login form, then navigates to the frontend</li>
33+
<li>The frontend parses the URL:
34+
<ul>
35+
<li>state=ScqT1B6mGWsExDiV // this must be the same as what we sent</li>
36+
<li>session_state=xx // we ignore that</li>
37+
<li>iss=xx // this is a string to identify the issuer, we ignore it</li>
38+
<li>code=xxxxx / this is a secret, not our token!</li>
39+
</ul>
40+
</li>
41+
<li>The frontend fetches the JWT token:
42+
<ul>
43+
<li>grant_type=authorization_code // no more blabla, give me the token now</li>
44+
<li>client_id=schweizmobil-website // same as before</li>
45+
<li>redirect_uri=xx // same as before</li>
46+
<li>code=xx // the secret we just received</li>
47+
<li>pkce=yy // the pkce secret we created at the very beginning</li>
48+
</ul>
49+
</li>
50+
<li>The frontend navigates to the initial URL and uses the token</li>
51+
</ol>
52+
</div>
1953
</body>
2054
</html>

0 commit comments

Comments
 (0)