File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed
main/java/com/google/api/client/auth/oauth2
test/java/com/google/api/client/auth/oauth2 Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -134,8 +134,8 @@ public AuthorizationCodeFlow(
134
134
GenericUrl tokenServerUrl ,
135
135
HttpExecuteInterceptor clientAuthentication ,
136
136
String clientId ,
137
- String authorizationServerEncodedUrl ,
138
- Map < String , String > additionalParameters ) {
137
+ String authorizationServerEncodedUrl )
138
+ {
139
139
this (
140
140
new Builder (
141
141
method ,
@@ -145,7 +145,8 @@ public AuthorizationCodeFlow(
145
145
clientAuthentication ,
146
146
clientId ,
147
147
authorizationServerEncodedUrl ,
148
- additionalParameters ));
148
+ Collections .<String , String >emptyMap ()
149
+ ));
149
150
}
150
151
151
152
/**
Original file line number Diff line number Diff line change 15
15
package com .google .api .client .auth .oauth2 ;
16
16
17
17
import java .util .Arrays ;
18
+ import java .util .HashMap ;
19
+ import java .util .Map ;
18
20
import junit .framework .TestCase ;
19
21
20
22
/**
@@ -41,4 +43,23 @@ public void testBuild() {
41
43
.setScopes (Arrays .asList ("a" , "b" , "c" ));
42
44
assertEquals (EXPECTED , url .build ());
43
45
}
46
+
47
+ public void testAdditionalParams () {
48
+
49
+ Map <String , String > testMap = new HashMap <>();
50
+ String expectedUrl =
51
+ "https://server.example.com/authorize?client_id=s6BhdRkqt3&"
52
+ + "redirect_uri=https://client.example.com/rd&response_type=code"
53
+ + "&scope=a%20b%20c&state=xyz¶m1=value1" ;
54
+
55
+ testMap .put ("param1" , "value1" );
56
+ AuthorizationRequestUrl url =
57
+ new AuthorizationCodeRequestUrl ("https://server.example.com/authorize" , "s6BhdRkqt3" )
58
+ .setState ("xyz" )
59
+ .setRedirectUri ("https://client.example.com/rd" )
60
+ .setScopes (Arrays .asList ("a" , "b" , "c" ));
61
+
62
+ assertEquals (expectedUrl , url .build ());
63
+ }
64
+
44
65
}
You can’t perform that action at this time.
0 commit comments