From 65c7cd6008b6c0d76afd23661f8726e92b0ddaf4 Mon Sep 17 00:00:00 2001 From: ShefeeqPM <86718986+ShefeeqPM@users.noreply.github.com> Date: Fri, 2 Feb 2024 14:38:18 +0530 Subject: [PATCH] removing duplicate open id scope (#26542) Signed-off-by: ShefeeqPM <86718986+ShefeeqPM@users.noreply.github.com> Signed-off-by: Michal Hajas Co-authored-by: Michal Hajas --- .../org/keycloak/protocol/oidc/OIDCWellKnownProvider.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/src/main/java/org/keycloak/protocol/oidc/OIDCWellKnownProvider.java b/services/src/main/java/org/keycloak/protocol/oidc/OIDCWellKnownProvider.java index 89d558c9cb9b..4fb2d45d7882 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/OIDCWellKnownProvider.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/OIDCWellKnownProvider.java @@ -181,7 +181,9 @@ public Object getConfig() { .filter(clientScope -> Objects.equals(OIDCLoginProtocol.LOGIN_PROTOCOL, clientScope.getProtocol())) .map(ClientScopeModel::getName) .collect(Collectors.toList()); - scopeNames.add(0, OAuth2Constants.SCOPE_OPENID); + if (!scopeNames.contains(OAuth2Constants.SCOPE_OPENID)) { + scopeNames.add(0, OAuth2Constants.SCOPE_OPENID); + } config.setScopesSupported(scopeNames); }