From 1ae296ce2c6faaaf62f58e51c1fcc6428575c589 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Tue, 30 Apr 2024 15:49:58 +1000 Subject: [PATCH 1/2] EE10AppEngineAuthentication should be using UserAuthenticationSucceeded not UserAuthenticationSent Signed-off-by: Lachlan Roberts --- .../jetty/EE10AppEngineAuthentication.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/shared_sdk_jetty12/src/main/java/com/google/apphosting/runtime/jetty/EE10AppEngineAuthentication.java b/shared_sdk_jetty12/src/main/java/com/google/apphosting/runtime/jetty/EE10AppEngineAuthentication.java index 1694153d..d2697e58 100644 --- a/shared_sdk_jetty12/src/main/java/com/google/apphosting/runtime/jetty/EE10AppEngineAuthentication.java +++ b/shared_sdk_jetty12/src/main/java/com/google/apphosting/runtime/jetty/EE10AppEngineAuthentication.java @@ -24,12 +24,6 @@ import jakarta.servlet.ServletRequest; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.security.Principal; -import java.util.Arrays; -import java.util.HashSet; -import java.util.function.Function; -import javax.security.auth.Subject; import org.eclipse.jetty.ee10.servlet.ServletContextRequest; import org.eclipse.jetty.ee10.servlet.security.ConstraintSecurityHandler; import org.eclipse.jetty.security.AuthenticationState; @@ -46,6 +40,13 @@ import org.eclipse.jetty.server.Session; import org.eclipse.jetty.util.Callback; +import javax.security.auth.Subject; +import java.io.IOException; +import java.security.Principal; +import java.util.Arrays; +import java.util.HashSet; +import java.util.function.Function; + /** * {@code AppEngineAuthentication} is a utility class that can configure a Jetty {@link * SecurityHandler} to integrate with the App Engine authentication model. @@ -191,7 +192,7 @@ public AuthenticationState validateRequest(Request req, Response res, Callback c UserIdentity user = _loginService.login(null, null, null, null); logger.atFine().log("authenticate() returning new principal for %s", user); if (user != null) { - return new UserAuthenticationSent(getAuthenticationType(), user); + return new UserAuthenticationSucceeded(getAuthenticationType(), user); } } From 8ac8467047982a0ace454f3830959b515e667ad2 Mon Sep 17 00:00:00 2001 From: Ludovic Champenois Date: Tue, 30 Apr 2024 08:17:32 -0700 Subject: [PATCH 2/2] Fix formatting in EE10AppEngineAuthentication.java --- .../runtime/jetty/EE10AppEngineAuthentication.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/shared_sdk_jetty12/src/main/java/com/google/apphosting/runtime/jetty/EE10AppEngineAuthentication.java b/shared_sdk_jetty12/src/main/java/com/google/apphosting/runtime/jetty/EE10AppEngineAuthentication.java index d2697e58..f502ba77 100644 --- a/shared_sdk_jetty12/src/main/java/com/google/apphosting/runtime/jetty/EE10AppEngineAuthentication.java +++ b/shared_sdk_jetty12/src/main/java/com/google/apphosting/runtime/jetty/EE10AppEngineAuthentication.java @@ -24,6 +24,12 @@ import jakarta.servlet.ServletRequest; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.security.Principal; +import java.util.Arrays; +import java.util.HashSet; +import java.util.function.Function; +import javax.security.auth.Subject; import org.eclipse.jetty.ee10.servlet.ServletContextRequest; import org.eclipse.jetty.ee10.servlet.security.ConstraintSecurityHandler; import org.eclipse.jetty.security.AuthenticationState; @@ -40,13 +46,6 @@ import org.eclipse.jetty.server.Session; import org.eclipse.jetty.util.Callback; -import javax.security.auth.Subject; -import java.io.IOException; -import java.security.Principal; -import java.util.Arrays; -import java.util.HashSet; -import java.util.function.Function; - /** * {@code AppEngineAuthentication} is a utility class that can configure a Jetty {@link * SecurityHandler} to integrate with the App Engine authentication model.