Error in revokeTokenForGoogleAuthentication

93 views
Skip to first unread message

Tom

unread,
Sep 7, 2011, 10:07:02 PM9/7/11
to GTM OAuth 2 Discussion
I'm using GDataServiceGooglePhotos and OAuth2 to connect to picasa and
download a users' albums; everything seems to be working correctly on
that front; I can authenticate and pull down the album feed. I have a
logout button where I attempt to revoke credentials as described in
the instructions:

[GTMOAuth2ViewControllerTouch
removeAuthFromKeychainForName:kPicasaKeychainItemName];
[GTMOAuth2ViewControllerTouch
revokeTokenForGoogleAuthentication:self.picasaAuth];
self.picasaAuth = nil;

When running this I get a exc_bad_access error in
revokeTokenForGoogleAuthentication; it appears to be when the
fetcherService property of the authentication object is accessed; I
don't see anything about explicitly setting that in the instructions
but I may be missing something.

Thanks for any help

Tom

Greg Robbins

unread,
Sep 7, 2011, 10:30:07 PM9/7/11
to gtm-o...@googlegroups.com
Once the authorizer has been attached to the service object, it issues fetchers using the service object. I would guess that at the point of token revocation, the service object has already been released.

Unfortunately, there's a circular dependence (the auth object relies on the service, and the service object relies on the auth object), so the auth object only weakly retains the fetcher service.

A safe workaround is just to set the auth.fetcherService to nil once the service has been released. 

Greg Robbins

unread,
Sep 9, 2011, 6:11:12 PM9/9/11
to gtm-o...@googlegroups.com
I've updated the fetcher service class to set the auth object's fetcherService property to nil before the fetcher service class is deallocated. This should avoid the need to for apps work around the issue.

Reply all
Reply to author
Forward
0 new messages