From 4ca1fecdaf68e5b633c4ee4cd95eae74c69a9239 Mon Sep 17 00:00:00 2001 From: Daniel Munzinger Date: Wed, 11 Mar 2020 09:25:02 +0100 Subject: [PATCH] KEYCLOAK-13289 Added redirect_url to Node.js logout --- securing_apps/topics/oidc/nodejs-adapter.adoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/securing_apps/topics/oidc/nodejs-adapter.adoc b/securing_apps/topics/oidc/nodejs-adapter.adoc index 1757ac4f13..ddc4dc8010 100644 --- a/securing_apps/topics/oidc/nodejs-adapter.adoc +++ b/securing_apps/topics/oidc/nodejs-adapter.adoc @@ -255,8 +255,21 @@ Explicit user-triggered logout:: By default, the middleware catches calls to `/logout` to send the user through a {project_name}-centric logout workflow. This can be changed by specifying a `logout` configuration parameter to the `middleware()` call: + [source,javascript] +---- app.use( keycloak.middleware( { logout: '/logoff' } )); +---- + +When the user-triggered logout is invoked a query parameter `redirect_url` can be passed: + +[source] +---- +https://example.com/logoff?redirect_url=https%3A%2F%2Fexample.com%3A3000%2Flogged%2Fout +---- + +This parameter is then used as the redirect url of the OIDC logout endpoint and the user will be redirected to +`\https://example.com/logged/out`. {project_name} Admin Callbacks::