From 5adfc77ee244ec4c4e8270703cc22c4960cf62c3 Mon Sep 17 00:00:00 2001 From: David Durieux Date: Sat, 18 Apr 2026 11:22:11 +0200 Subject: [PATCH] Change discord auth to oauth2 --- keycloak/scripts/bootstrap-discord-idp.sh | 35 +++++++++++++---------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/keycloak/scripts/bootstrap-discord-idp.sh b/keycloak/scripts/bootstrap-discord-idp.sh index 61aa3e2..d3ade1d 100755 --- a/keycloak/scripts/bootstrap-discord-idp.sh +++ b/keycloak/scripts/bootstrap-discord-idp.sh @@ -35,11 +35,14 @@ echo "Logging in to ${KC_SERVER_URL} as ${KEYCLOAK_ADMIN}..." --password "${KEYCLOAK_ADMIN_PASSWORD}" # ── Identity provider ──────────────────────────────────────────────────────── +# Discord does not implement OIDC (no id_token, no /.well-known endpoint), so +# we register it as a generic OAuth 2.0 provider (providerId: "oauth2") and +# point userInfoUrl at https://discord.com/api/users/@me. IDP_PAYLOAD=$(cat </dev/null 2>&1; then echo "Updating Discord IdP on realm ${KC_REALM}..." echo "${IDP_PAYLOAD}" | "${KCADM}" update "identity-provider/instances/${IDP_ALIAS}" -r "${KC_REALM}" -f - @@ -184,10 +188,11 @@ upsert_mapper "discord-username" "$(cat <