0
votes

I'm currently maintaining an iOS application developed by someone else. The application worked fine until today when suddenly it started returning 403 codes every time I tried to connect to Google Drive. This is the full error:

An error occurred: Error Domain=com.google.GTLJSONRPCErrorDomain Code=403 "The operation couldn’t be completed. (Access Not Configured. Please use Google Developers Console to activate the API for your project.)" UserInfo=0x17db6180 {error=Access Not Configured. Please use Google Developers Console to activate the API for your project., GTLStructuredError=GTLErrorObject 0x17db5ef0: {message:"Access Not Configured. Please use Google Developers Console to activate the API for your project." code:403 data:[1]}, NSLocalizedFailureReason=(Access Not Configured. Please use Google Developers Console to activate the API for your project.)}

I've enabled Google Drive in the Google Console and included the codes google gave me but I still can't overcome this error.

I'm using Google APIs Client Library for Objective-C to connect to GDrive.

6
Are you using https? Google might be denying access because they now prefer secure connections.ahwulf
I'm using the default that comes with GTL. This was also a very unexpected change.ruipacheco
Are you able to log the raw request? Ensure that you are either setting an API key in the URL or are passing OAuth2 credentials.Eric Koleda
I've reset the OAuth credentials several times, all to no avail.ruipacheco

6 Answers

1
votes

Hi I too got similar error in my mac machine 1 month before, I added DNS server 8.8.8.8 and worked fine. May be similar option will be available in iOS device too that can help you.

1
votes

I believe this issue is because of "API Key". Please make sure you have used API Key in the project and if you have already used that than check the validity of that key.

0
votes

Take a look at the errors for BigQuery https://developers.google.com/bigquery/troubleshooting-errors Google returns 403 errors for a number of different situations including some quota limitations.

Perhaps with Drive they use the same types of errors

0
votes

I think it is a recent change I believe. In google project console check if access to following is enabled:

  1. Contacts
  2. Google+

Also somebody suggested me to set "Referers" to "Any referer allowed". But not sure about it.

Please try.

0
votes

Here is fix to this Issue :

You just have to add the scope kGTLAuthScopeDriveFile in your Request. Please refer to below code for its implementation.

GTMOAuth2ViewControllerTouch *authController;
NSArray *scopes = [NSArray arrayWithObjects:kGTLAuthScopeDriveFile, nil];
authController = [[GTMOAuth2ViewControllerTouch alloc]
                  initWithScope:[scopes componentsJoinedByString:@" "]
                  clientID:kClientID
                  clientSecret:kClientSecret
                  keychainItemName:kKeychainItemName
                  delegate:self
                  finishedSelector:@selector(viewController:finishedWithAuth:error:)];

IMPORTANT : Now you have to authorize your user again so that The Permission can be granted to the user correctly.

After that Your Code will work Perfectly !

0
votes

This appeared to be on Google's side. One phone call to them with no changes on our side seems to have fixed it.