feat(cli/server.go): allow the use of public OIDC clients (#16489)

Support public OIDC clients

- Enables support for public OIDC clients by only checking for a client
ID being set. This allows for confidential and public clients to be used
with Coder's OIDC authentication.
- Also adds a public client configuration to the development OIDC setup
script.

Fixes #16135

Change-Id: Iadd85d40c2faa595a0498e25d3407a1f94b5c8a8
Signed-off-by: Thomas Kosiewski <tk@coder.com>

Signed-off-by: Thomas Kosiewski <tk@coder.com>
This commit is contained in:
Thomas Kosiewski
2025-02-07 14:06:38 +01:00
committed by GitHub
parent 584503180b
commit 6a67e2ede6
2 changed files with 20 additions and 1 deletions
+14
View File
@@ -49,6 +49,17 @@ cat <<EOF >/tmp/example-realm.json
"baseUrl": "/coder",
"redirectUris": ["*"],
"secret": "coder"
},
{
"clientId": "coder-public",
"publicClient": true,
"directAccessGrantsEnabled": true,
"enabled": true,
"fullScopeAllowed": true,
"baseUrl": "/coder",
"redirectUris": [
"*"
]
}
]
}
@@ -79,6 +90,9 @@ hostname=$(hostname -f)
export CODER_OIDC_ISSUER_URL="http://${hostname}:9080/realms/coder"
export CODER_OIDC_CLIENT_ID=coder
export CODER_OIDC_CLIENT_SECRET=coder
# Comment out the two lines above, and comment in the line below,
# to configure OIDC auth using a public client.
# export CODER_OIDC_CLIENT_ID=coder-public
export CODER_DEV_ACCESS_URL="http://${hostname}:8080"
exec "${SCRIPT_DIR}/develop.sh" "$@"