Become a MacRumors Supporter for $25/year with no ads, private forums, and more!
  • Did you order new AirTags? We've opened a dedicated AirTags forum.

iosmike

macrumors newbie
Original poster
Apr 28, 2016
28
5
Toronto, Canada
I followed the Google Drive API for iOS Quicstart and created a sample project, everything works ok. But when I did exactly the same thing to an existing project and ran on simulator. On simulator screen it shows:

The operation couldn't be completed. (com.google.HTTPStatus error 401).

In console it shows:

Error data:
{
error = "unauthorized_client";
"error_description" = Unauthorized
}

I searched and didn't find exactly the same error and other kinds of error help information didn't work out. Please give me a clue. Thanks!
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
The operation couldn't be completed. (com.google.HTTPStatus error 401).

I often use the wikipedia HTTP Status Code page for info on return codes. https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

401 usually means the user hasn't successfully logged in. It can also mean something like a token has expired or the app hasn't sent a valid app secret when attempting to log in.

403 is similar. Usually the difference is that 401 can be fixed and 403 cannot be fixed. For instance if the user passes bad credentials that can be fixed but if the user is attempting to access a URL that it doesn't have permissions for this can't be fixed.
 
Last edited by a moderator:
Comment

iosmike

macrumors newbie
Original poster
Apr 28, 2016
28
5
Toronto, Canada
I often use the wikipedia HTTP Status Code page for info on return codes. https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

401 usually means the user hasn't successfully logged in. It can also mean something like a token has expired or the app hasn't sent a valid app secret when attempting to log in.

403 is similar. Usually the difference is that 401 can be fixed and 403 cannot be fixed. For instance if the user passes bad credentials that can be fixed but if the user is attempting to access a URL that it doesn't have permissions for this can't be fixed.
Thanks for the clue. Let me see if I can fix the problem.
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.