Remove iframe version detection from Keycloak JS (#33101)

Closes #33100

Signed-off-by: Jon Koops <jonkoops@gmail.com>
This commit is contained in:
Jon Koops 2024-09-20 15:58:37 +02:00 committed by GitHub
parent e065070751
commit aa9e6c730e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -39,13 +39,6 @@ function Keycloak (config) {
kc.didInitialize = false; kc.didInitialize = false;
var scripts = document.getElementsByTagName('script');
for (var i = 0; i < scripts.length; i++) {
if ((scripts[i].src.indexOf('keycloak.js') !== -1 || scripts[i].src.indexOf('keycloak.min.js') !== -1) && scripts[i].src.indexOf('version=') !== -1) {
kc.iframeVersion = scripts[i].src.substring(scripts[i].src.indexOf('version=') + 8).split('&')[0];
}
}
var useNonce = true; var useNonce = true;
var logInfo = createLogger(console.info); var logInfo = createLogger(console.info);
var logWarn = createLogger(console.warn); var logWarn = createLogger(console.warn);
@ -847,18 +840,10 @@ function Keycloak (config) {
return getRealmUrl() + '/protocol/openid-connect/logout'; return getRealmUrl() + '/protocol/openid-connect/logout';
}, },
checkSessionIframe: function() { checkSessionIframe: function() {
var src = getRealmUrl() + '/protocol/openid-connect/login-status-iframe.html'; return getRealmUrl() + '/protocol/openid-connect/login-status-iframe.html';
if (kc.iframeVersion) {
src = src + '?version=' + kc.iframeVersion;
}
return src;
}, },
thirdPartyCookiesIframe: function() { thirdPartyCookiesIframe: function() {
var src = getRealmUrl() + '/protocol/openid-connect/3p-cookies/step1.html'; return getRealmUrl() + '/protocol/openid-connect/3p-cookies/step1.html';
if (kc.iframeVersion) {
src = src + '?version=' + kc.iframeVersion;
}
return src;
}, },
register: function() { register: function() {
return getRealmUrl() + '/protocol/openid-connect/registrations'; return getRealmUrl() + '/protocol/openid-connect/registrations';