title: Difficulty in authenticating iOS with google storage using GTMOAuth2
body: <p>I've been working on this for over a day so now asking for help! I'm trying to write an iOS app that authenticates using a google service account in order to access Google storage. </p>
  
  <p>I can't get beyond this error which occurs at the authoriseRequest and when trying to create a bucket.</p>
  
  <blockquote>
    <p>Error Domain=com.google.GTMOAuth2 Code=-1001 "The operation couldn’t be completed. (com.google.GTMOAuth2 error -1001.)" UserInfo=0x15640740 {request= { URL: <a href="https://www.googleapis.com/rpc?prettyPrint=false" rel="nofollow">https://www.googleapis.com/rpc?prettyPrint=false</a> }}</p>
  </blockquote>
  
  <p>It's my first time working with the google objective c libraries and almost all of the examples that I've found online, and in stackOverflow are aimed at using GTMOAuth2ViewControllerTouch, but I'm not authenticating from the user</p>
  
  <p>So far, I've gotten this. </p>
  
  <p>Before my init .. </p>
  
  <pre><code>static GTLServiceStorage *storageService = nil;
  static GTMOAuth2Authentication *auth;
  </code></pre>
  
  <p>In my init .. </p>
  
  <pre><code>auth = [ GTMOAuth2SignIn standardGoogleAuthenticationForScope:@"kGTLAuthScopeStorageDevstorageFullControl" clientID:@"my_client_id.apps.googleusercontent.com" clientSecret:@"my_client_secret"];
  auth.redirectURI = @"urn:ietf:wg:oauth:2.0:oob";
  // inititialising the auth token
  [auth authorizeRequest:nil  delegate:self didFinishSelector:@selector(authentication:request:finishedWithError:)];
  
  // init googleStorage Backend service.
  if (!storageService) {
      storageService = [[GTLServiceStorage alloc] init];
      storageService.additionalHTTPHeaders = @{@"x-goog-project-id": @"my_project_id", @"Content-Type": @"application/json-rpc", @"Accept":
                                                   @"application/json-rpc"};
      storageService.authorizer = auth;
      storageService.retryEnabled = YES;
  }
  </code></pre>
  
  <p>And in a method to create a bucket for example..</p>
  
  <pre><code>// Create a GTLStorageBucket.
  GTLStorageBucket* bucket = [[GTLStorageBucket alloc] init];
  bucket.name = @"myBucketName";
  // Create the query
  GTLQueryStorage *query = [GTLQueryStorage queryForBucketsInsertWithObject:bucket project:@"myGoogleProjectID"];
  [storageService executeQuery:query completionHandler:^(GTLServiceTicket *ticket, GTLStorageBucket  *object, NSError *error) {
      NSLog(@"bucket %@", object);
  }];
  </code></pre>
  
  <p>My question is, am I using the gtmoauth2 library correctly for a service account authentication, and if so am I missing something obvious in my parameters or my initialisation. </p>
  
  <p>Thanks</p>