From d7e274322de22141ccbdaab4f49c747ac672e0e3 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Tue, 14 Jan 2025 15:24:58 +1100 Subject: [PATCH] PR #12698 - fixes for SignInWithEthereumTest Signed-off-by: Lachlan Roberts --- .../eclipse/jetty/security/siwe/SignInWithEthereumTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jetty-integrations/jetty-ethereum/src/test/java/org/eclipse/jetty/security/siwe/SignInWithEthereumTest.java b/jetty-integrations/jetty-ethereum/src/test/java/org/eclipse/jetty/security/siwe/SignInWithEthereumTest.java index 9707c51d0e3d..20b88d377449 100644 --- a/jetty-integrations/jetty-ethereum/src/test/java/org/eclipse/jetty/security/siwe/SignInWithEthereumTest.java +++ b/jetty-integrations/jetty-ethereum/src/test/java/org/eclipse/jetty/security/siwe/SignInWithEthereumTest.java @@ -72,7 +72,9 @@ public boolean handle(Request request, Response response, Callback callback) thr String pathInContext = Request.getPathInContext(request); if ("/error".equals(pathInContext)) { - response.write(true, BufferUtil.toBuffer("ERROR"), callback); + response.setStatus(HttpStatus.FORBIDDEN_403); + String error = Request.getParameters(request).get(EthereumAuthenticator.ERROR_PARAMETER).getValue(); + response.write(true, BufferUtil.toBuffer(error), callback); return true; } if ("/login".equals(pathInContext)) @@ -94,6 +96,7 @@ else if ("/logout".equals(pathInContext)) }; _authenticator = new EthereumAuthenticator(); + _authenticator.setErrorPage("/error"); SecurityHandler.PathMapped securityHandler = new SecurityHandler.PathMapped(); securityHandler.setAuthenticator(_authenticator);