Skip to content

Commit fec3538

Browse files
author
Yaniv Inbar
committed
change default of useBasicAuthorization to false
http://codereview.appspot.com/4475044/
1 parent 0fd18d6 commit fec3538

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

google-api-client-extensions/src/main/java/com/google/api/client/extensions/auth/helpers/oauth2/draft10/OAuth2ThreeLeggedFlow.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ public Credential complete(String authorizationCode) throws IOException {
119119
clientSecret,
120120
authorizationCode,
121121
callbackUrl);
122-
request.useBasicAuthorization = false;
123122

124123
AccessTokenResponse response = request.execute();
125124

google-api-client-googleapis/src/main/java/com/google/api/client/googleapis/auth/oauth2/draft10/GoogleAccessTokenRequest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ public GoogleAssertionGrant(HttpTransport transport, JsonFactory jsonFactory,
194194
*/
195195
static void init(AccessTokenRequest request) {
196196
request.authorizationServerUrl = AUTHORIZATION_SERVER_URL;
197-
request.useBasicAuthorization = false;
198197
}
199198

200199
private GoogleAccessTokenRequest() {

google-api-client/src/main/java/com/google/api/client/auth/oauth2/draft10/AccessTokenRequest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,12 +418,15 @@ public enum GrantType {
418418
public String authorizationServerUrl;
419419

420420
/**
421-
* Defaults to {@code true} to use Basic Authentication as recommended in <a
421+
* {@code false} to specify the password in the request body using the {@code "clientSecret"}
422+
* parameter in the HTTP body or {@code true} to use Basic Authentication as recommended in <a
422423
* href="http://tools.ietf.org/html/draft-ietf-oauth-v2-10#section-2.1">Client Password
423-
* Credentials</a>, but may be set to {@code false} for for specifying the password in the request
424-
* body using the {@code "clientSecret"} parameter in the HTTP body.
424+
* Credentials</a>.
425+
* <p>
426+
* Defaults to {@code false}.
427+
* </p>
425428
*/
426-
public boolean useBasicAuthorization = true;
429+
public boolean useBasicAuthorization;
427430

428431
/**
429432
* Executes request for an access token, and returns the HTTP response.

google-api-client/src/test/java/com/google/api/client/auth/oauth2/draft10/AccessTokenRequestTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private void check(AccessTokenRequest request, boolean withParameters) {
147147

148148
private void check(AccessTokenRequest request, GrantType grantType, boolean withParameters) {
149149
assertEquals(grantType, request.grantType);
150-
assertTrue(request.useBasicAuthorization);
150+
assertFalse(request.useBasicAuthorization);
151151
assertNull(request.scope);
152152
if (withParameters) {
153153
assertEquals(TRANSPORT, request.transport);

0 commit comments

Comments
 (0)