From c38b3261f4957269acb738421afc9f97d80bfc40 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Wed, 13 Jul 2022 15:28:21 +1000 Subject: [PATCH] Issue #8216 - fix broken test OpenIdAuthenticationTest Signed-off-by: Lachlan Roberts --- .../jetty/security/openid/OpenIdAuthenticationTest.java | 1 + .../java/org/eclipse/jetty/security/openid/OpenIdProvider.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdAuthenticationTest.java b/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdAuthenticationTest.java index 951893e9ce80..521568dfdd4e 100644 --- a/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdAuthenticationTest.java +++ b/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdAuthenticationTest.java @@ -104,6 +104,7 @@ public void setup() throws Exception server.addBean(new OpenIdConfiguration(openIdProvider.getProvider(), CLIENT_ID, CLIENT_SECRET)); securityHandler.setInitParameter(OpenIdAuthenticator.REDIRECT_PATH, "/redirect_path"); securityHandler.setInitParameter(OpenIdAuthenticator.ERROR_PAGE, "/error"); + securityHandler.setInitParameter(OpenIdAuthenticator.LOGOUT_REDIRECT_PATH, "/"); context.setSecurityHandler(securityHandler); server.start(); diff --git a/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdProvider.java b/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdProvider.java index 022f92a2c122..24c30146fa88 100644 --- a/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdProvider.java +++ b/jetty-openid/src/test/java/org/eclipse/jetty/security/openid/OpenIdProvider.java @@ -321,7 +321,8 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws I String logoutRedirect = req.getParameter("post_logout_redirect_uri"); if (logoutRedirect == null) { - resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "no post_logout_redirect_uri"); + resp.setStatus(HttpServletResponse.SC_OK); + resp.getWriter().println("logout success on end_session_endpoint"); return; }