Skip to content

Commit 483a824

Browse files
Merge pull request #11064 from rabbitmq/make-end-session-endpoint-optional
OAuth 2: log out from IDP only when an end_session_endpoint is available
2 parents 72dc78f + 68b18d6 commit 483a824

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

deps/rabbitmq_management/priv/www/js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function start_app_login () {
167167
});
168168
}
169169
})
170-
// TODO REFACTOR: this code can be simplified
170+
171171
if (oauth.enabled) {
172172
if (has_auth_credentials()) {
173173
check_login();

deps/rabbitmq_management/priv/www/js/oidc-oauth/helper.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,23 @@ function oauth_completeLogin() {
243243

244244
function oauth_initiateLogout() {
245245
if (oauth.sp_initiated) {
246-
mgr.signoutRedirect()
246+
mgr.metadataService.getEndSessionEndpoint().then(endpoint => {
247+
if (endpoint == undefined) {
248+
// Logout only from management UI
249+
mgr.removeUser().then(res => {
250+
clear_auth()
251+
oauth_redirectToLogin()
252+
})
253+
}else {
254+
// OpenId Connect RP-Initiated Logout
255+
mgr.signoutRedirect()
256+
}
257+
})
247258
} else {
248259
go_to_authority()
249260
}
250261
}
262+
251263
function oauth_completeLogout() {
252264
clear_auth()
253265
mgr.signoutRedirectCallback().then(_ => oauth_redirectToLogin())
@@ -265,8 +277,5 @@ function validate_openid_configuration(payload) {
265277
if (typeof payload.jwks_uri != 'string') {
266278
throw new Error("Missing jwks_uri")
267279
}
268-
if (typeof payload.end_session_endpoint != 'string') {
269-
throw new Error("Missing end_session_endpoint")
270-
}
271280

272281
}

deps/rabbitmq_management/selenium/bin/components/selenium

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/usr/bin/env bash
22

3-
SELENIUM_DOCKER_IMAGE=selenium/standalone-chrome:103.0
3+
arch=$(uname -i)
4+
if [[ $arch == arm* ]]; then
5+
SELENIUM_DOCKER_IMAGE=selenium/standalone-chrome:123.0
6+
else
7+
SELENIUM_DOCKER_IMAGE=seleniarm/standalone-chromium:123.0
8+
fi
49

510
start_selenium() {
611
begin "Starting selenium ..."

deps/rabbitmq_management/selenium/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
"author": "",
1515
"license": "ISC",
1616
"dependencies": {
17-
"chromedriver": "^121.0.0",
17+
"chromedriver": "^123.0.0",
1818
"ejs": "^3.1.8",
1919
"express": "^4.18.2",
2020
"geckodriver": "^3.0.2",
2121
"http-proxy": "^1.18.1",
2222
"mqtt": "^5.3.3",
2323
"path": "^0.12.7",
2424
"proxy": "^1.0.2",
25-
"selenium-webdriver": "^4.15.0",
25+
"selenium-webdriver": "^4.19.0",
2626
"xmlhttprequest": "^1.8.0"
2727
},
2828
"devDependencies": {
2929
"chai": "^4.3.6",
30-
"mocha": "^10.0.0",
30+
"mocha": "^10.4.0",
3131
"request": "^2.88.2",
3232
"standard": "^17.0.0"
3333
}

0 commit comments

Comments
 (0)