Error handling in google oauth 2 driver request 400

we have several google oauth2 update tokens for Google Drive, for which we always get the following error when trying to request a new access token:

POST /o/oauth2/token HTTP/1.1 Connection: close accept-encoding: gzip, deflate content-type: application/x-www-form-urlencoded Content-Length: 208 Host: accounts.google.com refresh_token=1%2FY5_2XY8uGujYa222rxXnsjR<snipped>&client_id=<clientid>&grant_type=refresh_token&client_secret=<clientsecret> 

Answer:

 HTTP/1.1 400 Error processing OAuth 2 request Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: Fri, 01 Jan 1990 00:00:00 GMT Date: Tue, 20 Aug 2013 14:55:24 GMT <HTML> <HEAD> <TITLE>Error processing OAuth 2 request</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1>Error processing OAuth 2 request</H1> <H2>Error 400</H2> </BODY> </HTML> 

This only happens for some accounts, others work fine. Broken accounts do not play for days or weeks. Is there something wrong with the data we send? Any hint that does not confirm validation?

I could provide you with tokens that do not work if necessary.

+4
source share
1 answer

As far as I can tell, all of these update tokens fail due to invalid user accounts (deleted, disconnected, etc.). In these cases, the token itself is invalid for all purposes and tasks.

The HTML error response is an error, and it should be fixed by now. Let me know if you still see errors like this. The correct OAuth 2 error code in this case is "invalid_token".

0
source

Source: https://habr.com/ru/post/1498031/


All Articles