GTMOAuthViewControllerTouch returns a HTTP code 400 for a single user

50 views
Skip to first unread message

Jorge Luis Mendez

unread,
Apr 2, 2012, 7:02:41 PM4/2/12
to gtm-...@googlegroups.com
Hi,

I've been trying to solve a bug report with our iOS app. Basically, the user is clicking on a button that pushes a UINavigationController with GTMOAuthViewControllerTouch as the root view controller. Right after launching the user is getting an error message triggered by GTMOAuthViewControllerTouch's delegate returning with NSError *error with a "400" code. This is happening to two of the user devices. Note that I haven't been able to reproduce the problem myself and that the problem has not been reported by anybody else.

Any ideas what could be going wrong?

Thank you.

Signing code (slightly modified for simplicity) :

- (void)addDomain {
NSString *const kAdminSettingsScope = @"https://apps-apis.google.com/a/feeds/";
NSString *const kProvisioningScope = @"https://apps-apis.google.com/a/feeds/domain/" ;
  NSString *scope = 
    [NSString stringWithFormat:@"%@ %@", kAdminSettingsScope, kProvisioningScope];
  SEL OAuthFinishedSelector = @selector(viewController:finishedWithAuth:error:);
  
  NSString *randomKeychain = @"RANDOM-KEYCHAIN";
  
  GTMOAuthViewControllerTouch *oauthViewController =
    [[GTMOAuthViewControllerTouch alloc] initWithScope:scope
                                               language:nil
                                         appServiceName:randomKeychain
                                               delegate:self
                                       finishedSelector:OAuthFinishedSelector];
  [oauthViewController setTitle:NSLocalizedString(@"Add Domain", 
                                                  nil)];

  ...UINavigationController configuration, colors, etc...

  [self presentModalViewController:nc animated:YES];

  [nc release];
  
  return;
}


Delegate code:

- (void)viewController:(GTMOAuthViewControllerTouch *)viewController 
      finishedWithAuth:(GTMOAuthAuthentication *)auth
                 error:(NSError *)error {
  if (!error) {
  
    //Authentication succeeded
    ...
    
  } else {
  
    // Authentication failed
    ...  
    
    } else if (errorCode == kOAuthAccessDenied) {
    
      The User Is Getting the Msg Here.
      .... 
      
    }
}

Greg Robbins

unread,
Apr 3, 2012, 8:13:48 PM4/3/12
to gtm-...@googlegroups.com
It would probably require turning on the library fetcher's http logging feature on the user's device to determine what is going wrong.

A 400 status isn't enough information; the error and [error userInfo] may offer more clues.

Rare problems are often tied to networking issues, such as intrusive proxies. It's helpful when possible to get the user to try on a different kind of network connection.

Jorge Luis Mendez

unread,
Apr 4, 2012, 10:53:24 AM4/4/12
to gtm-...@googlegroups.com
Thanks Greg. I'll try to get more information and will get to the list if I find something of value.

Cheers,
--
Jorge Luis
web iteridea.com | twitter @iteridea
Reply all
Reply to author
Forward
0 new messages