From 92e1041208d5a48e3c036003c94690d81ebd177a Mon Sep 17 00:00:00 2001 From: Rudolph Russell Date: Tue, 5 Sep 2023 16:30:17 +0000 Subject: [PATCH 1/6] feat: Support additional request parameters for 3LO --- .../auth/oauth2/AuthorizationCodeFlow.java | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java index 4b4944fff..b2d3525ea 100644 --- a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java +++ b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java @@ -112,6 +112,9 @@ public class AuthorizationCodeFlow { /** Refresh listeners provided by the client. */ private final Collection refreshListeners; + /** Additional parameters to pass to authorization url. */ + private final Map additionalParameters; + /** * @param method method of presenting the access token to the resource server (for example {@link * BearerToken#authorizationHeaderAccessMethod}) @@ -131,7 +134,8 @@ public AuthorizationCodeFlow( GenericUrl tokenServerUrl, HttpExecuteInterceptor clientAuthentication, String clientId, - String authorizationServerEncodedUrl) { + String authorizationServerEncodedUrl, + Map additionalParameters) { this( new Builder( method, @@ -140,7 +144,8 @@ public AuthorizationCodeFlow( tokenServerUrl, clientAuthentication, clientId, - authorizationServerEncodedUrl)); + authorizationServerEncodedUrl, + additionalParameters)); } /** @@ -156,6 +161,7 @@ protected AuthorizationCodeFlow(Builder builder) { clientId = Preconditions.checkNotNull(builder.clientId); authorizationServerEncodedUrl = Preconditions.checkNotNull(builder.authorizationServerEncodedUrl); + additionalParameters = Preconditions.checkNotNull(builder.additionalParameters); requestInitializer = builder.requestInitializer; credentialStore = builder.credentialStore; credentialDataStore = builder.credentialDataStore; @@ -192,6 +198,11 @@ public AuthorizationCodeRequestUrl newAuthorizationUrl() { url.setCodeChallenge(pkce.getChallenge()); url.setCodeChallengeMethod(pkce.getChallengeMethod()); } + if (additionalParameters != null) { + for (Map.Entry entry : additionalParameters.entrySet()) { + url.put(entry.getKey(), entry.getValue()); + } + } return url; } @@ -549,6 +560,9 @@ public static class Builder { /** Refresh listeners provided by the client. */ Collection refreshListeners = Lists.newArrayList(); + /** Additional authorization url parameters provided by the client **/ + Map additionalParameters; + /** * @param method method of presenting the access token to the resource server (for example * {@link BearerToken#authorizationHeaderAccessMethod}) @@ -567,7 +581,8 @@ public Builder( GenericUrl tokenServerUrl, HttpExecuteInterceptor clientAuthentication, String clientId, - String authorizationServerEncodedUrl) { + String authorizationServerEncodedUrl, + Map additionalParameters) { setMethod(method); setTransport(transport); setJsonFactory(jsonFactory); @@ -575,6 +590,7 @@ public Builder( setClientAuthentication(clientAuthentication); setClientId(clientId); setAuthorizationServerEncodedUrl(authorizationServerEncodedUrl); + setAdditionalParameters(additionalParameters); } /** Returns a new instance of an authorization code flow based on this builder. */ @@ -717,6 +733,20 @@ public Builder setAuthorizationServerEncodedUrl(String authorizationServerEncode return this; } + /** + * Sets the additional url parameters. + * + *

Overriding is only supported for the purpose of calling the super implementation and + * changing the return type, but nothing else. + * + * @since 1.11 + */ + public Builder setAdditionalParameters(Map additionalParameters) { + this.additionalParameters = + Preconditions.checkNotNull(additionalParameters); + return this; + } + /** * {@link Beta}
* Returns the credential persistence store or {@code null} for none. From 5c24548147008e620214d47f4a594fc0a66da85d Mon Sep 17 00:00:00 2001 From: Rudolph Russell Date: Thu, 7 Sep 2023 17:56:08 +0000 Subject: [PATCH 2/6] Add tests. --- .../auth/oauth2/AuthorizationCodeFlow.java | 7 ++++--- .../AuthorizationCodeRequestUrlTest.java | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java index b2d3525ea..1a90492fb 100644 --- a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java +++ b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java @@ -134,8 +134,8 @@ public AuthorizationCodeFlow( GenericUrl tokenServerUrl, HttpExecuteInterceptor clientAuthentication, String clientId, - String authorizationServerEncodedUrl, - Map additionalParameters) { + String authorizationServerEncodedUrl) + { this( new Builder( method, @@ -145,7 +145,8 @@ public AuthorizationCodeFlow( clientAuthentication, clientId, authorizationServerEncodedUrl, - additionalParameters)); + Collections.emptyMap() + )); } /** diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java index eaa730505..678bf2728 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java @@ -15,6 +15,8 @@ package com.google.api.client.auth.oauth2; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; import junit.framework.TestCase; /** @@ -41,4 +43,23 @@ public void testBuild() { .setScopes(Arrays.asList("a", "b", "c")); assertEquals(EXPECTED, url.build()); } + + public void testAdditionalParams() { + + Map testMap = new HashMap<>(); + String expectedUrl = + "https://server.example.com/authorize?client_id=s6BhdRkqt3&" + + "redirect_uri=https://client.example.com/rd&response_type=code" + + "&scope=a%20b%20c&state=xyz¶m1=value1"; + + testMap.put("param1", "value1"); + AuthorizationRequestUrl url = + new AuthorizationCodeRequestUrl("https://server.example.com/authorize", "s6BhdRkqt3") + .setState("xyz") + .setRedirectUri("https://client.example.com/rd") + .setScopes(Arrays.asList("a", "b", "c")); + + assertEquals(expectedUrl, url.build()); + } + } From f1e815b5f196cce1eb3651bf37a6ed0b3b1558dc Mon Sep 17 00:00:00 2001 From: Rudolph Russell Date: Thu, 14 Sep 2023 17:09:30 +0000 Subject: [PATCH 3/6] updated tests --- .../auth/oauth2/AuthorizationCodeFlow.java | 47 +++++++++++++++++-- .../oauth2/AuthorizationCodeFlowTest.java | 22 +++++++++ .../AuthorizationCodeRequestUrlTest.java | 2 + 3 files changed, 68 insertions(+), 3 deletions(-) diff --git a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java index 1a90492fb..2bd08575a 100644 --- a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java +++ b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java @@ -136,6 +136,28 @@ public AuthorizationCodeFlow( String clientId, String authorizationServerEncodedUrl) { + this( + new Builder( + method, + transport, + jsonFactory, + tokenServerUrl, + clientAuthentication, + clientId, + authorizationServerEncodedUrl) + ); + } + + public AuthorizationCodeFlow( + AccessMethod method, + HttpTransport transport, + JsonFactory jsonFactory, + GenericUrl tokenServerUrl, + HttpExecuteInterceptor clientAuthentication, + String clientId, + String authorizationServerEncodedUrl, + Map additionalParameters) + { this( new Builder( method, @@ -145,8 +167,8 @@ public AuthorizationCodeFlow( clientAuthentication, clientId, authorizationServerEncodedUrl, - Collections.emptyMap() - )); + additionalParameters) + ); } /** @@ -575,7 +597,26 @@ public static class Builder { * @param clientId client identifier * @param authorizationServerEncodedUrl authorization server encoded URL */ - public Builder( + + public Builder( + AccessMethod method, + HttpTransport transport, + JsonFactory jsonFactory, + GenericUrl tokenServerUrl, + HttpExecuteInterceptor clientAuthentication, + String clientId, + String authorizationServerEncodedUrl) { + setMethod(method); + setTransport(transport); + setJsonFactory(jsonFactory); + setTokenServerUrl(tokenServerUrl); + setClientAuthentication(clientAuthentication); + setClientId(clientId); + setAuthorizationServerEncodedUrl(authorizationServerEncodedUrl); + setAdditionalParameters(Collections.emptyMap()); + } + + public Builder( AccessMethod method, HttpTransport transport, JsonFactory jsonFactory, diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlowTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlowTest.java index a63495cf1..7030bc842 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlowTest.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlowTest.java @@ -23,6 +23,8 @@ import java.util.Collection; import java.util.Collections; import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; import java.util.Set; /** @@ -154,4 +156,24 @@ public void testPKCE() { assertTrue(methods.contains(url.getCodeChallengeMethod().toLowerCase())); assertTrue(url.getCodeChallenge().length() > 0); } + + public void testAdditionalParameters() { + Map testMap = new HashMap<>(); + testMap.put("key", "value"); + AuthorizationCodeFlow flow = + new AuthorizationCodeFlow.Builder( + BearerToken.queryParameterAccessMethod(), + new AccessTokenTransport(), + new GsonFactory(), + TOKEN_SERVER_URL, + new BasicAuthentication(CLIENT_ID, CLIENT_SECRET), + CLIENT_ID, + "https://example.com") + .setAdditionalParameters(testMap) + .build(); + + AuthorizationCodeRequestUrl url = flow.newAuthorizationUrl(); + String urlString = url.build(); + assertTrue(urlString.contains("key=value")); + } } diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java index 678bf2728..0c0513c6b 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java @@ -44,6 +44,7 @@ public void testBuild() { assertEquals(EXPECTED, url.build()); } + /* public void testAdditionalParams() { Map testMap = new HashMap<>(); @@ -61,5 +62,6 @@ public void testAdditionalParams() { assertEquals(expectedUrl, url.build()); } + */ } From 6be02e8456f99538f519bf00cddf9be8a0055331 Mon Sep 17 00:00:00 2001 From: Rudolph Russell Date: Thu, 14 Sep 2023 18:43:12 +0000 Subject: [PATCH 4/6] updated tests --- .../auth/oauth2/AuthorizationCodeFlow.java | 25 +++---------------- .../AuthorizationCodeRequestUrlTest.java | 20 --------------- 2 files changed, 3 insertions(+), 42 deletions(-) diff --git a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java index 2bd08575a..5aedec4a5 100644 --- a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java +++ b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java @@ -166,8 +166,8 @@ public AuthorizationCodeFlow( tokenServerUrl, clientAuthentication, clientId, - authorizationServerEncodedUrl, - additionalParameters) + authorizationServerEncodedUrl) + .setAdditionalParameters(additionalParameters) ); } @@ -184,7 +184,7 @@ protected AuthorizationCodeFlow(Builder builder) { clientId = Preconditions.checkNotNull(builder.clientId); authorizationServerEncodedUrl = Preconditions.checkNotNull(builder.authorizationServerEncodedUrl); - additionalParameters = Preconditions.checkNotNull(builder.additionalParameters); + additionalParameters = builder.additionalParameters; requestInitializer = builder.requestInitializer; credentialStore = builder.credentialStore; credentialDataStore = builder.credentialDataStore; @@ -616,25 +616,6 @@ public Builder( setAdditionalParameters(Collections.emptyMap()); } - public Builder( - AccessMethod method, - HttpTransport transport, - JsonFactory jsonFactory, - GenericUrl tokenServerUrl, - HttpExecuteInterceptor clientAuthentication, - String clientId, - String authorizationServerEncodedUrl, - Map additionalParameters) { - setMethod(method); - setTransport(transport); - setJsonFactory(jsonFactory); - setTokenServerUrl(tokenServerUrl); - setClientAuthentication(clientAuthentication); - setClientId(clientId); - setAuthorizationServerEncodedUrl(authorizationServerEncodedUrl); - setAdditionalParameters(additionalParameters); - } - /** Returns a new instance of an authorization code flow based on this builder. */ public AuthorizationCodeFlow build() { return new AuthorizationCodeFlow(this); diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java index 0c0513c6b..cce69448f 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java @@ -44,24 +44,4 @@ public void testBuild() { assertEquals(EXPECTED, url.build()); } - /* - public void testAdditionalParams() { - - Map testMap = new HashMap<>(); - String expectedUrl = - "https://server.example.com/authorize?client_id=s6BhdRkqt3&" - + "redirect_uri=https://client.example.com/rd&response_type=code" - + "&scope=a%20b%20c&state=xyz¶m1=value1"; - - testMap.put("param1", "value1"); - AuthorizationRequestUrl url = - new AuthorizationCodeRequestUrl("https://server.example.com/authorize", "s6BhdRkqt3") - .setState("xyz") - .setRedirectUri("https://client.example.com/rd") - .setScopes(Arrays.asList("a", "b", "c")); - - assertEquals(expectedUrl, url.build()); - } - */ - } From 640a745dceebe9df5c5130babb89566523c64b5a Mon Sep 17 00:00:00 2001 From: Rudolph Russell Date: Tue, 19 Sep 2023 16:36:19 +0000 Subject: [PATCH 5/6] removed unused imports --- .../auth/oauth2/AuthorizationCodeFlow.java | 68 +++++++++---------- .../oauth2/AuthorizationCodeFlowTest.java | 30 ++++---- .../AuthorizationCodeRequestUrlTest.java | 3 - 3 files changed, 46 insertions(+), 55 deletions(-) diff --git a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java index 5aedec4a5..7775751d9 100644 --- a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java +++ b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java @@ -134,8 +134,7 @@ public AuthorizationCodeFlow( GenericUrl tokenServerUrl, HttpExecuteInterceptor clientAuthentication, String clientId, - String authorizationServerEncodedUrl) - { + String authorizationServerEncodedUrl) { this( new Builder( method, @@ -144,8 +143,7 @@ public AuthorizationCodeFlow( tokenServerUrl, clientAuthentication, clientId, - authorizationServerEncodedUrl) - ); + authorizationServerEncodedUrl)); } public AuthorizationCodeFlow( @@ -156,19 +154,17 @@ public AuthorizationCodeFlow( HttpExecuteInterceptor clientAuthentication, String clientId, String authorizationServerEncodedUrl, - Map additionalParameters) - { + Map additionalParameters) { this( new Builder( - method, - transport, - jsonFactory, - tokenServerUrl, - clientAuthentication, - clientId, - authorizationServerEncodedUrl) - .setAdditionalParameters(additionalParameters) - ); + method, + transport, + jsonFactory, + tokenServerUrl, + clientAuthentication, + clientId, + authorizationServerEncodedUrl) + .setAdditionalParameters(additionalParameters)); } /** @@ -184,7 +180,7 @@ protected AuthorizationCodeFlow(Builder builder) { clientId = Preconditions.checkNotNull(builder.clientId); authorizationServerEncodedUrl = Preconditions.checkNotNull(builder.authorizationServerEncodedUrl); - additionalParameters = builder.additionalParameters; + additionalParameters = builder.additionalParameters; requestInitializer = builder.requestInitializer; credentialStore = builder.credentialStore; credentialDataStore = builder.credentialDataStore; @@ -583,7 +579,7 @@ public static class Builder { /** Refresh listeners provided by the client. */ Collection refreshListeners = Lists.newArrayList(); - /** Additional authorization url parameters provided by the client **/ + /** Additional authorization url parameters provided by the client * */ Map additionalParameters; /** @@ -597,24 +593,23 @@ public static class Builder { * @param clientId client identifier * @param authorizationServerEncodedUrl authorization server encoded URL */ - - public Builder( - AccessMethod method, - HttpTransport transport, - JsonFactory jsonFactory, - GenericUrl tokenServerUrl, - HttpExecuteInterceptor clientAuthentication, - String clientId, - String authorizationServerEncodedUrl) { - setMethod(method); - setTransport(transport); - setJsonFactory(jsonFactory); - setTokenServerUrl(tokenServerUrl); - setClientAuthentication(clientAuthentication); - setClientId(clientId); - setAuthorizationServerEncodedUrl(authorizationServerEncodedUrl); - setAdditionalParameters(Collections.emptyMap()); - } + public Builder( + AccessMethod method, + HttpTransport transport, + JsonFactory jsonFactory, + GenericUrl tokenServerUrl, + HttpExecuteInterceptor clientAuthentication, + String clientId, + String authorizationServerEncodedUrl) { + setMethod(method); + setTransport(transport); + setJsonFactory(jsonFactory); + setTokenServerUrl(tokenServerUrl); + setClientAuthentication(clientAuthentication); + setClientId(clientId); + setAuthorizationServerEncodedUrl(authorizationServerEncodedUrl); + setAdditionalParameters(Collections.emptyMap()); + } /** Returns a new instance of an authorization code flow based on this builder. */ public AuthorizationCodeFlow build() { @@ -765,8 +760,7 @@ public Builder setAuthorizationServerEncodedUrl(String authorizationServerEncode * @since 1.11 */ public Builder setAdditionalParameters(Map additionalParameters) { - this.additionalParameters = - Preconditions.checkNotNull(additionalParameters); + this.additionalParameters = Preconditions.checkNotNull(additionalParameters); return this; } diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlowTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlowTest.java index 7030bc842..cae90a760 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlowTest.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlowTest.java @@ -22,8 +22,8 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.HashSet; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -161,19 +161,19 @@ public void testAdditionalParameters() { Map testMap = new HashMap<>(); testMap.put("key", "value"); AuthorizationCodeFlow flow = - new AuthorizationCodeFlow.Builder( - BearerToken.queryParameterAccessMethod(), - new AccessTokenTransport(), - new GsonFactory(), - TOKEN_SERVER_URL, - new BasicAuthentication(CLIENT_ID, CLIENT_SECRET), - CLIENT_ID, - "https://example.com") - .setAdditionalParameters(testMap) - .build(); - - AuthorizationCodeRequestUrl url = flow.newAuthorizationUrl(); - String urlString = url.build(); - assertTrue(urlString.contains("key=value")); + new AuthorizationCodeFlow.Builder( + BearerToken.queryParameterAccessMethod(), + new AccessTokenTransport(), + new GsonFactory(), + TOKEN_SERVER_URL, + new BasicAuthentication(CLIENT_ID, CLIENT_SECRET), + CLIENT_ID, + "https://example.com") + .setAdditionalParameters(testMap) + .build(); + + AuthorizationCodeRequestUrl url = flow.newAuthorizationUrl(); + String urlString = url.build(); + assertTrue(urlString.contains("key=value")); } } diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java index cce69448f..eaa730505 100644 --- a/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java +++ b/google-oauth-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java @@ -15,8 +15,6 @@ package com.google.api.client.auth.oauth2; import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import junit.framework.TestCase; /** @@ -43,5 +41,4 @@ public void testBuild() { .setScopes(Arrays.asList("a", "b", "c")); assertEquals(EXPECTED, url.build()); } - } From 73a046c0122332a30452cc49e21aef196e79e2c6 Mon Sep 17 00:00:00 2001 From: Rudolph Russell Date: Tue, 19 Sep 2023 17:46:25 +0000 Subject: [PATCH 6/6] removed unecessary method overload --- .../auth/oauth2/AuthorizationCodeFlow.java | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java index 7775751d9..f6a4fa6d4 100644 --- a/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java +++ b/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java @@ -146,27 +146,6 @@ public AuthorizationCodeFlow( authorizationServerEncodedUrl)); } - public AuthorizationCodeFlow( - AccessMethod method, - HttpTransport transport, - JsonFactory jsonFactory, - GenericUrl tokenServerUrl, - HttpExecuteInterceptor clientAuthentication, - String clientId, - String authorizationServerEncodedUrl, - Map additionalParameters) { - this( - new Builder( - method, - transport, - jsonFactory, - tokenServerUrl, - clientAuthentication, - clientId, - authorizationServerEncodedUrl) - .setAdditionalParameters(additionalParameters)); - } - /** * @param builder authorization code flow builder * @since 1.14