Closed GoogleCodeExporter closed 9 years ago
I just tried signing in with the sample app in the simulator, and had no
trouble.
Try putting breakpoints in the GDataSignIn class at the requestFetcher:
callback methods, and look at [error userInfo] for additional details about the
error.
Be sure to include GDataHTTPLogging.m/h in your project and define DEBUG=1 to
get logging and debugging facilities.
The mailing lists should be used for support and questions, rather than the
issue tracker.
GData: http://groups.google.com/group/gdata-objectivec-client
GTM OAuth: http://groups.google.com/group/gtm-oauth
Original comment by gregrobbins
on 6 Nov 2010 at 3:42
Weird. I didn't see anything requiring #define DEBUG 1 in the header file, if
indeed that is what you mean. In any event including the header and #defining
DEBUG 1 did not work for logging.
The BAD request occurs as I push the controllers userInfo on the error is: data
= <54696d65 7374616d 70206973 20746f6f 20666172 2066726f 6d206375 7272656e
74207469 6d653a20 31323839 30363932 38350a0a>;
Not sure what to make of a bunch of hex strings.
The callback failedWithError appears to be called just after the view
controller is pushed on the navigation controller's stack. As it is supposed
to handle authentication soup-to-nuts through its own web view, and I am not
making the request myself, there is at least something very nonobvious going on
in the GData code causing it to return the (quite unhelpful) "Bad Request"
response.
In other words it simply fails to get the authentication page for some reason.
The code is fairly straight forward, mostly taken from the example. Nothing
crazy here.
-(BOOL) authenticate {
GDataOAuthViewControllerTouch * authVC = [[[GDataOAuthViewControllerTouch alloc] initWithScope:[GDataServiceGoogleDocs authorizationScope]
language:nil
appServiceName:@"Transcript 0.1: Google Docs"
delegate:self
finishedSelector:@selector(viewController:finishedWithAuth:error:)] autorelease];
[self.navController pushViewController:authVC animated:YES];
return NO;
}
-(GDataOAuthAuthentication *) getValidAuthorizer {
GDataOAuthAuthentication * auther = [GDataOAuthViewControllerTouch authForGoogleFromKeychainForName:@"ipadTranscript"];
if (![auther canAuthorize]) {
auther = nil;
}
return auther;
}
- (void)viewController:(GDataOAuthViewControllerTouch *)viewController
finishedWithAuth:(GDataOAuthAuthentication *)auth
error:(NSError *)error {
if (error != nil) {
UIAlertView *someError = [[UIAlertView alloc] initWithTitle: @"Authentication Failed" message: [error localizedDescription] delegate: nil cancelButtonTitle: @"Ok" otherButtonTitles: nil];
[someError show];
[someError release];
//alert that authentication failed and leave viewController pushed.
} else {
[self.navController popViewControllerAnimated:YES];
[self createDocBrowserWithAuthorizer:auth];
[self.docBrowser fetch];
}
}
Original comment by johnlaba...@gmail.com
on 6 Nov 2010 at 7:09
That hex is the string "Timestamp is too far from current time: 1289069285".
Perhaps the system clock is far from correct.
The library projects may string logging code if the DEBUG compiler flag is not
set.
Original comment by gregrobbins
on 6 Nov 2010 at 7:36
Many thanks for the superb help on Saturday! Looks like my machine may be time
traveling..
Original comment by johnlaba...@gmail.com
on 6 Nov 2010 at 9:38
Thanks gregrobbins ,I also solved the same problem.
Original comment by burningc...@gmail.com
on 22 Jun 2011 at 3:09
Original issue reported on code.google.com by
johnlaba...@gmail.com
on 6 Nov 2010 at 2:34