From 913056b2b2d39707347a39dddb7bdad69fe47cc3 Mon Sep 17 00:00:00 2001 From: Jon Koops Date: Thu, 7 Nov 2019 14:34:19 +0100 Subject: [PATCH] [KEYCLOAK-11971] Remove credentials option from configuration --- adapters/oidc/js/src/main/resources/keycloak.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/adapters/oidc/js/src/main/resources/keycloak.js b/adapters/oidc/js/src/main/resources/keycloak.js index 03926a2a1a..f48c1bb64b 100755 --- a/adapters/oidc/js/src/main/resources/keycloak.js +++ b/adapters/oidc/js/src/main/resources/keycloak.js @@ -613,11 +613,7 @@ req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); req.withCredentials = true; - if (kc.clientId && kc.clientSecret) { - req.setRequestHeader('Authorization', 'Basic ' + btoa(kc.clientId + ':' + kc.clientSecret)); - } else { - params += '&client_id=' + encodeURIComponent(kc.clientId); - } + params += '&client_id=' + encodeURIComponent(kc.clientId); var timeLocal = new Date().getTime(); @@ -728,12 +724,7 @@ req.open('POST', url, true); req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); - if (kc.clientId && kc.clientSecret) { - req.setRequestHeader('Authorization', 'Basic ' + btoa(kc.clientId + ':' + kc.clientSecret)); - } else { - params += '&client_id=' + encodeURIComponent(kc.clientId); - } - + params += '&client_id=' + encodeURIComponent(kc.clientId); params += '&redirect_uri=' + oauth.redirectUri; if (oauth.pkceCodeVerifier) { @@ -863,7 +854,6 @@ kc.authServerUrl = config['auth-server-url']; kc.realm = config['realm']; kc.clientId = config['resource']; - kc.clientSecret = (config['credentials'] || {})['secret']; setupOidcEndoints(null); promise.setSuccess(); } else { @@ -879,7 +869,6 @@ } kc.clientId = config.clientId; - kc.clientSecret = (config.credentials || {}).secret; var oidcProvider = config['oidcProvider']; if (!oidcProvider) {