Implement SSO via OIDC (#127)

Resolves https://github.com/unmojang/drasl/issues/39

* Use __Host- cookie prefix instead of setting Domain

See https://stackoverflow.com/a/64735551

* Unlinking OIDC accounts

* AllowPasswordLogin, OIDC docs, cleanup

* YggdrasilError

* Migrate existing password users without login

* API query/create/delete user OIDC identities

* test APICreateOIDCIdentity

* test APIDeleteeOIDCIdentity

* API Create users with OIDC identities

* OIDC: PKCE

* Use YggdrasilError in authlib-injector routes

* OIDC: AllowChoosingPlayerName

* recipes.md: Update for OIDC and deprecated config options

* OIDC: fix APICreateUser without password, validate oidcIdentities

* OIDC: error at complete-registration if no preferred player name

* Proper error pages

* MC_ prefix for Minecraft Tokens
This commit is contained in:
Evan Goode
2025-03-22 16:40:26 -04:00
committed by GitHub
parent 09c9192cca
commit 5c1f6c1cfa
44 changed files with 2973 additions and 725 deletions

74
public/openid-logo.svg Normal file
View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.0"
width="320"
height="120"
viewBox="0 0 6440 8334"
id="svg2114"
xml:space="preserve"
sodipodi:docname="openid-logo.svg"
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="1.828125"
inkscape:cx="159.45299"
inkscape:cy="92.444444"
inkscape:window-width="1291"
inkscape:window-height="1056"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="g2189" /><defs
id="defs2127">
</defs>
<g
transform="matrix(69.45,0,0,69.45,-8759.476,-989.3969)"
id="g2189"><g
transform="matrix(1.031807e-2,0,0,1.031807e-2,143.3621,-90.91537)"
id="g2202"><path
d="M -3436.8,14543.2 C -4284.8,14015.2 -5468.8,13687.2 -6764.8,13687.2 C -9372.8,13687.2 -11484.8,14991.2 -11484.8,16599.2 C -11484.8,18071.2 -9724.8,19279.2 -7444.8,19487.2 L -7444.8,18639.2 C -8980.8,18447.2 -10132.8,17607.2 -10132.8,16599.2 C -10132.8,15455.2 -8628.8,14519.2 -6764.8,14519.2 C -5836.8,14519.2 -4996.8,14751.2 -4388.8,15127.2 L -5252.8,15663.2 L -2556.8,15663.2 L -2556.8,13999.2 L -3436.8,14543.2 z "
style="fill:#ccc;fill-opacity:1"
id="path2204" /><path
d="M -7444.8,12247.2 L -7444.8,18639.2 L -7444.8,19487.2 L -6092.8,18639.2 L -6092.8,11375.2 L -7444.8,12247.2 z "
style="fill:#ff6200;fill-opacity:1"
id="path2206" /></g><g
transform="matrix(1.377521e-2,0,0,1.377521e-2,142.3208,-135.7131)"
id="g2208"><path
d="M -1124.8,15343.2 C -1060.8,15119.2 -956.8,14927.2 -820.8,14759.2 C -676.8,14591.2 -508.8,14455.2 -300.8,14359.2 C -92.8,14255.2 147.2,14207.2 419.2,14207.2 C 699.2,14207.2 939.2,14255.2 1147.2,14359.2 C 1347.2,14455.2 1523.2,14591.2 1659.2,14759.2 C 1795.2,14927.2 1899.2,15119.2 1963.2,15343.2 C 2035.2,15559.2 2067.2,15791.2 2067.2,16031.2 C 2067.2,16271.2 2035.2,16503.2 1963.2,16727.2 C 1899.2,16943.2 1795.2,17135.2 1659.2,17303.2 C 1523.2,17471.2 1347.2,17607.2 1147.2,17703.2 C 939.2,17807.2 699.2,17855.2 419.2,17855.2 C 147.2,17855.2 -92.8,17807.2 -300.8,17703.2 C -508.8,17607.2 -676.8,17471.2 -820.8,17303.2 C -956.8,17135.2 -1060.8,16943.2 -1124.8,16727.2 C -1196.8,16503.2 -1228.8,16271.2 -1228.8,16031.2 C -1228.8,15791.2 -1196.8,15559.2 -1124.8,15343.2 M -820.8,16599.2 C -772.8,16783.2 -692.8,16943.2 -580.8,17095.2 C -476.8,17239.2 -340.8,17351.2 -172.8,17447.2 C -4.8,17535.2 187.2,17575.2 419.2,17575.2 C 651.2,17575.2 851.2,17535.2 1019.2,17447.2 C 1187.2,17351.2 1315.2,17239.2 1427.2,17095.2 C 1531.2,16943.2 1611.2,16783.2 1659.2,16599.2 C 1707.2,16415.2 1739.2,16223.2 1739.2,16031.2 C 1739.2,15839.2 1707.2,15655.2 1659.2,15471.2 C 1611.2,15287.2 1531.2,15119.2 1427.2,14975.2 C 1315.2,14831.2 1187.2,14711.2 1019.2,14623.2 C 851.2,14535.2 651.2,14495.2 419.2,14495.2 C 187.2,14495.2 -4.8,14535.2 -172.8,14623.2 C -340.8,14711.2 -476.8,14831.2 -580.8,14975.2 C -692.8,15119.2 -772.8,15287.2 -820.8,15471.2 C -868.8,15655.2 -892.8,15839.2 -892.8,16031.2 C -892.8,16223.2 -868.8,16415.2 -820.8,16599.2 z "
style="fill:#ff6200;fill-opacity:1"
id="path2210" /><path
d="M 2563.2,15255.2 L 2563.2,15735.2 L 2571.2,15735.2 C 2643.2,15559.2 2763.2,15423.2 2923.2,15327.2 C 3083.2,15231.2 3267.2,15183.2 3475.2,15183.2 C 3667.2,15183.2 3835.2,15215.2 3979.2,15287.2 C 4123.2,15359.2 4243.2,15455.2 4339.2,15583.2 C 4427.2,15703.2 4499.2,15847.2 4547.2,16007.2 C 4595.2,16167.2 4619.2,16343.2 4619.2,16519.2 C 4619.2,16703.2 4595.2,16871.2 4547.2,17031.2 C 4499.2,17191.2 4427.2,17335.2 4339.2,17455.2 C 4243.2,17583.2 4123.2,17679.2 3979.2,17751.2 C 3835.2,17815.2 3667.2,17855.2 3475.2,17855.2 C 3379.2,17855.2 3291.2,17839.2 3195.2,17823.2 C 3107.2,17799.2 3019.2,17759.2 2947.2,17719.2 C 2867.2,17671.2 2795.2,17615.2 2731.2,17543.2 C 2675.2,17479.2 2627.2,17399.2 2595.2,17303.2 L 2587.2,17303.2 L 2587.2,18711.2 L 2275.2,18711.2 L 2275.2,15255.2 L 2563.2,15255.2 M 4259.2,16135.2 C 4227.2,15999.2 4179.2,15887.2 4115.2,15783.2 C 4043.2,15687.2 3955.2,15599.2 3851.2,15535.2 C 3747.2,15471.2 3627.2,15447.2 3475.2,15447.2 C 3307.2,15447.2 3163.2,15471.2 3051.2,15535.2 C 2931.2,15591.2 2843.2,15671.2 2771.2,15767.2 C 2707.2,15863.2 2659.2,15983.2 2627.2,16111.2 C 2603.2,16239.2 2587.2,16375.2 2587.2,16519.2 C 2587.2,16655.2 2603.2,16783.2 2635.2,16911.2 C 2667.2,17039.2 2715.2,17159.2 2787.2,17255.2 C 2859.2,17359.2 2947.2,17439.2 3059.2,17503.2 C 3171.2,17567.2 3315.2,17599.2 3475.2,17599.2 C 3627.2,17599.2 3747.2,17567.2 3851.2,17503.2 C 3955.2,17439.2 4043.2,17359.2 4115.2,17255.2 C 4179.2,17159.2 4227.2,17039.2 4259.2,16911.2 C 4291.2,16783.2 4307.2,16655.2 4307.2,16519.2 C 4307.2,16391.2 4291.2,16263.2 4259.2,16135.2 z "
style="fill:#ff6200;fill-opacity:1"
id="path2212" /><path
d="M 5139.2,16951.2 C 5171.2,17071.2 5219.2,17175.2 5291.2,17271.2 C 5355.2,17367.2 5443.2,17447.2 5547.2,17503.2 C 5651.2,17567.2 5779.2,17599.2 5923.2,17599.2 C 6147.2,17599.2 6323.2,17543.2 6451.2,17423.2 C 6579.2,17303.2 6667.2,17151.2 6715.2,16951.2 L 7027.2,16951.2 C 6963.2,17239.2 6843.2,17463.2 6667.2,17615.2 C 6491.2,17775.2 6243.2,17855.2 5923.2,17855.2 C 5723.2,17855.2 5555.2,17815.2 5411.2,17751.2 C 5259.2,17679.2 5147.2,17583.2 5051.2,17455.2 C 4963.2,17335.2 4891.2,17191.2 4851.2,17031.2 C 4803.2,16871.2 4787.2,16703.2 4787.2,16519.2 C 4787.2,16351.2 4803.2,16191.2 4851.2,16031.2 C 4891.2,15871.2 4963.2,15727.2 5051.2,15599.2 C 5147.2,15471.2 5259.2,15375.2 5411.2,15295.2 C 5555.2,15223.2 5723.2,15183.2 5923.2,15183.2 C 6123.2,15183.2 6299.2,15223.2 6443.2,15303.2 C 6587.2,15383.2 6707.2,15495.2 6795.2,15623.2 C 6883.2,15759.2 6947.2,15911.2 6987.2,16079.2 C 7027.2,16247.2 7043.2,16423.2 7035.2,16599.2 L 5091.2,16599.2 C 5091.2,16711.2 5107.2,16831.2 5139.2,16951.2 M 6667.2,16007.2 C 6627.2,15895.2 6571.2,15799.2 6507.2,15719.2 C 6435.2,15639.2 6355.2,15567.2 6259.2,15519.2 C 6155.2,15471.2 6051.2,15447.2 5923.2,15447.2 C 5795.2,15447.2 5683.2,15471.2 5587.2,15519.2 C 5491.2,15567.2 5403.2,15639.2 5339.2,15719.2 C 5267.2,15799.2 5211.2,15895.2 5171.2,16007.2 C 5131.2,16111.2 5107.2,16223.2 5091.2,16343.2 L 6723.2,16343.2 C 6723.2,16223.2 6699.2,16111.2 6667.2,16007.2 z "
style="fill:#ff6200;fill-opacity:1"
id="path2214" /><path
d="M 7499.2,15255.2 L 7499.2,15687.2 L 7507.2,15687.2 C 7571.2,15535.2 7675.2,15415.2 7827.2,15319.2 C 7971.2,15231.2 8139.2,15183.2 8323.2,15183.2 C 8499.2,15183.2 8643.2,15207.2 8763.2,15247.2 C 8883.2,15295.2 8979.2,15359.2 9051.2,15447.2 C 9123.2,15527.2 9171.2,15631.2 9203.2,15751.2 C 9235.2,15871.2 9243.2,16007.2 9243.2,16159.2 L 9243.2,17783.2 L 8939.2,17783.2 L 8939.2,16207.2 C 8939.2,16095.2 8931.2,15999.2 8907.2,15903.2 C 8891.2,15815.2 8851.2,15735.2 8803.2,15663.2 C 8755.2,15591.2 8691.2,15543.2 8603.2,15503.2 C 8523.2,15463.2 8419.2,15447.2 8299.2,15447.2 C 8171.2,15447.2 8059.2,15463.2 7963.2,15511.2 C 7867.2,15551.2 7787.2,15615.2 7723.2,15687.2 C 7651.2,15767.2 7603.2,15855.2 7563.2,15967.2 C 7523.2,16071.2 7507.2,16183.2 7499.2,16311.2 L 7499.2,17783.2 L 7195.2,17783.2 L 7195.2,15255.2 L 7499.2,15255.2 z "
style="fill:#ff6200;fill-opacity:1"
id="path2216" /><path
d="M 9835.2,14287.2 L 9835.2,17783.2 L 9507.2,17783.2 L 9507.2,14287.2 L 9835.2,14287.2 z "
style="fill:#ff6200;fill-opacity:1"
id="path2218" /><path
d="M 11299.2,14287.2 C 11835.2,14295.2 12235.2,14447.2 12507.2,14735.2 C 12771.2,15023.2 12907.2,15455.2 12907.2,16031.2 C 12907.2,16615.2 12771.2,17047.2 12507.2,17335.2 C 12235.2,17623.2 11835.2,17767.2 11299.2,17783.2 L 10091.2,17783.2 L 10091.2,14287.2 L 11299.2,14287.2 M 11139.2,17495.2 C 11387.2,17495.2 11603.2,17471.2 11787.2,17415.2 C 11963.2,17359.2 12115.2,17279.2 12235.2,17159.2 C 12347.2,17039.2 12435.2,16887.2 12491.2,16703.2 C 12547.2,16519.2 12571.2,16295.2 12571.2,16031.2 C 12571.2,15775.2 12547.2,15551.2 12491.2,15367.2 C 12435.2,15175.2 12347.2,15023.2 12235.2,14911.2 C 12115.2,14791.2 11963.2,14703.2 11787.2,14655.2 C 11603.2,14599.2 11387.2,14567.2 11139.2,14567.2 L 10427.2,14567.2 L 10427.2,17495.2 L 11139.2,17495.2 z "
style="fill:#ff6200;fill-opacity:1"
id="path2220" /></g></g></svg>

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@@ -39,6 +39,10 @@ td:not(:first-child) {
padding-left: 0.5rem;
}
td:last-child {
text-align: right;
}
thead {
font-weight: bold;
}
@@ -59,6 +63,22 @@ a:visited {
gap: 0.5em;
}
.divider {
display: flex;
align-items: center;
padding: 5px 0;
gap: 0.5em;
}
.divider::before, .divider::after {
content: "";
flex: 1;
border-top: 1px solid white;
}
.openid-logo {
height: 3rem;
vertical-align: middle;
}
.logo {
font-family: Helvetica, Arial, sans-serif;
color: white;
@@ -149,9 +169,9 @@ input[type="file"]::file-selector-button {
0 0 0 var(--button-highlight-size) black;
}
button:hover,
input[type="submit"]:hover,
input[type="file"]::file-selector-button:hover {
button:hover:not(:disabled),
input[type="submit"]:hover:not(:disabled),
input[type="file"]::file-selector-button:hover:not(:disabled) {
box-shadow:
0 var(--button-shadow-size) 0 0 var(--button-shadow-light) inset,
var(--button-shadow-size) 0 0 0 var(--button-shadow-light) inset,
@@ -160,9 +180,9 @@ input[type="file"]::file-selector-button:hover {
0 0 0 var(--button-highlight-size) var(--accent-light);
}
button:active,
input[type="submit"]:active,
input[type="file"]::file-selector-button:active {
button:active:not(:disabled),
input[type="submit"]:active:not(:disabled),
input[type="file"]::file-selector-button:active:not(:disabled) {
box-shadow:
0 var(--button-shadow-size) 0 0 var(--button-shadow-dark) inset,
var(--button-shadow-size) 0 0 0 var(--button-shadow-dark) inset,