File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
javatests/com/google/auth/oauth2
java/com/google/auth/oauth2 Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -315,10 +315,14 @@ public void revokeAuthorization(String userId) throws IOException {
315315 OAuth2Utils .validateOptionalString (tokenJson , "refresh_token" , TOKEN_STORE_ERROR );
316316 // If both tokens are present, either can be used
317317 String revokeToken = (refreshToken != null ) ? refreshToken : accessTokenValue ;
318+
318319 GenericUrl revokeUrl = new GenericUrl (OAuth2Utils .TOKEN_REVOKE_URI );
319- revokeUrl .put ("token" , revokeToken );
320+ GenericData genericData = new GenericData ();
321+ genericData .put ("token" , revokeToken );
322+ UrlEncodedContent content = new UrlEncodedContent (genericData );
323+
320324 HttpRequestFactory requestFactory = transportFactory .create ().createRequestFactory ();
321- HttpRequest tokenRequest = requestFactory .buildGetRequest (revokeUrl );
325+ HttpRequest tokenRequest = requestFactory .buildPostRequest (revokeUrl , content );
322326 tokenRequest .execute ();
323327
324328 if (deleteTokenException != null ) {
Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ public LowLevelHttpResponse execute() throws IOException {
257257 return new MockLowLevelHttpRequest (url ) {
258258 @ Override
259259 public LowLevelHttpResponse execute () throws IOException {
260- Map <String , String > parameters = TestUtils .parseQuery (query );
260+ Map <String , String > parameters = TestUtils .parseQuery (this . getContentAsString () );
261261 String token = parameters .get ("token" );
262262 if (token == null ) {
263263 throw new IOException ("Token to revoke not found." );
You can’t perform that action at this time.
0 commit comments