From 19ce849c187fa308669ac93c158696ed1a92f31c Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 20 May 2025 09:36:07 -0400 Subject: [PATCH 1/2] fix: update approval_prompt=force to prompt=consent --- oauth2_http/java/com/google/auth/oauth2/UserAuthorizer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oauth2_http/java/com/google/auth/oauth2/UserAuthorizer.java b/oauth2_http/java/com/google/auth/oauth2/UserAuthorizer.java index 5a008c705..8d19d79fb 100644 --- a/oauth2_http/java/com/google/auth/oauth2/UserAuthorizer.java +++ b/oauth2_http/java/com/google/auth/oauth2/UserAuthorizer.java @@ -206,7 +206,7 @@ public URL getAuthorizationUrl( url.put("state", state); } url.put("access_type", "offline"); - url.put("approval_prompt", "force"); + url.put("prompt", "consent"); if (userId != null) { url.put("login_hint", userId); } From 3f61ee85c0b1a7685e235d778c6c4e53457c2f63 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 21 May 2025 10:27:11 -0400 Subject: [PATCH 2/2] chore: Update test to check to prompt query --- .../javatests/com/google/auth/oauth2/UserAuthorizerTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/oauth2_http/javatests/com/google/auth/oauth2/UserAuthorizerTest.java b/oauth2_http/javatests/com/google/auth/oauth2/UserAuthorizerTest.java index d53241fed..1d1341560 100644 --- a/oauth2_http/javatests/com/google/auth/oauth2/UserAuthorizerTest.java +++ b/oauth2_http/javatests/com/google/auth/oauth2/UserAuthorizerTest.java @@ -207,6 +207,7 @@ public void getAuthorizationUrl() throws IOException { assertEquals("code", parameters.get("response_type")); assertEquals(pkce.getCodeChallenge(), parameters.get("code_challenge")); assertEquals(pkce.getCodeChallengeMethod(), parameters.get("code_challenge_method")); + assertEquals("consent", parameters.get("prompt")); } @Test