Picasa oAuth token invalid

120 views
Skip to first unread message

Cystig

unread,
Jan 10, 2011, 3:48:40 PM1/10/11
to Google Data APIs Objective-C Client Library Discussion
Hi
I am trying to use the oAuth functions for Picasa. I am able to login
and get an access code but when I try to use it gives me an error that
the token is invalid. Your input is greatly appreciated.

Cystig

unread,
Jan 10, 2011, 3:48:48 PM1/10/11
to Google Data APIs Objective-C Client Library Discussion

Greg Robbins

unread,
Jan 10, 2011, 5:42:10 PM1/10/11
to gdata-objec...@googlegroups.com
I was just able to convert the GooglePhotosSample application to authentiacte with OAuth by replacing the username/password code in the window controller with this OAuth sign-in code.

- (void)signInWithOAuth {
  NSString *scope = [GDataServiceGooglePhotos authorizationScope];
  
  GDataOAuthWindowController *controller = [[[GDataOAuthWindowController alloc] initWithScope:scope
    language:nil
    appServiceName:kAppServiceName
    resourceBundle:nil] autorelease];

  [controller signInSheetModalForWindow:[self window]
    delegate:self
    finishedSelector:@selector(windowController:finishedWithAuth:error:)];
}

- (void)windowController:(GDataOAuthWindowController *)windowController
        finishedWithAuth:(GDataOAuthAuthentication *)auth
                   error:(NSError *)error {
  if (error != nil) {
    // sign in failed
  } else {
    NSString *username = [auth userEmail];
    [mUsernameField setStringValue:username];
    
    [[self googlePhotosService] setAuthorizer:auth];
    
    [self fetchAllAlbums];
  }
}

The sample app was then able to fetch the photos feed successfully.

Jay Cystig

unread,
Jan 10, 2011, 5:51:00 PM1/10/11
to gdata-objec...@googlegroups.com
Thanks a lot, I think it this fixes the problem, I am now getting http
error 503 which seems to be just that the server is busy.

> --
> You received this message because you are subscribed to the Google
> Groups "Google Data APIs Objective-C Client Library Discussion" group.
> To post to this group, send email to
> gdata-objec...@googlegroups.com.
> To unsubscribe from this group, send email to
> gdata-objectivec-...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/gdata-objectivec-client?hl=en.

Jay Cystig

unread,
Jan 10, 2011, 7:00:57 PM1/10/11
to gdata-objec...@googlegroups.com
I tried it again and i think I might have crossed the auth token barrier
now I keep getting the following error "com.google.GDataServiceDomain
error 503.".

On 1/10/11 4:42 PM, Greg Robbins wrote:

Greg Robbins

unread,
Jan 11, 2011, 8:16:47 PM1/11/11
to gdata-objec...@googlegroups.com
I have reproduced the 503 status when doing chunked uploads of photos via OAuth. The photos server team is looking into the problem.

As a workaround, you can disable chunked uploading. To do that, set the upload chunk size to zero, like

  [service setServiceUploadChunkSize:0];

and use the post link as the URL for inserting the photo into the feed,

  NSURL *uploadURL = [[albumFeedOfPhotos postLink] URL];

Jay Cystig

unread,
Jan 12, 2011, 1:53:01 PM1/12/11
to gdata-objec...@googlegroups.com, Greg Robbins
Thanks for the quick response, We now have other issues

When we are using NSURL *uploadURL = [NSURL URLWithString:kGDataGooglePhotosDropBoxUploadURL]; and not setting the GDataServiceGooglePhotos serviceUploadChunkSize to zero we are getting the 503 status.

When we set the serviceUploadChunkSize to zero with the same uploadURL we are getting the "Content type is unsupported" error.

When we set the serviceUploadChunkSize to zero and use NSURL *uploadURL = [[[GDataFeedPhoto photoFeed] postLink] URL]; we are not getting any error but its not sending.

We not sure why this is happening. Your feedback is appreciated

Greg Robbins

unread,
Jan 12, 2011, 2:15:31 PM1/12/11
to gdata-objec...@googlegroups.com
To upload photos to the drop box non-chunked (chunk size zero) insert directly to this URL:

  feedURL = [GDataServiceGooglePhotos photoFeedURLForUserID:kGDataServiceDefaultUser
     albumID:@"default" albumName:nil photoID:nil kind:nil access:nil];

Link elements are present in feeds and entries retrieved from a server, but are not present in those objects when created explicitly by the client app.

Reply all
Reply to author
Forward
0 new messages