PubSub Framework Fails On Authenticated Gmail Feed

Originator:willia4
Number:rdar://10475065 Date Originated:11/19/2011
Status:Open Resolved:
Product:Mac OS X Product Version:10.7.2
Classification:Other Bug Reproducible:Always
 
Summary: When using the PubSub Framework with the authenticated Gmail feed at https://mail.google.com/mail/feed/atom/inbox, it returns the error 

"Last Error: Error Domain=NSURLErrorDomain Code=-1013 "A username and password are required" UserInfo=0x102027790 {NSLocalizedDescription=A username and password are required}" 

even when the username and password are set correctly using the PSFeed's setLogin: and setPassword: methods.

Steps to Reproduce:

-(void)feedRefreshing:(NSNotification*)n
{
    PSFeed *f = [n object];
    NSLog(@"Last Error: %@", [f lastError]);
}

-(void)testPubSub:
{
    PSClient *client = [PSClient applicationClient];
    NSURL    *url    = [NSURL URLWithString:@"https://mail.google.com/mail/feed/atom/inbox"];
    PSFeed   *feed   = [client addFeedWithURL:url];

    [feed setLogin: @"correctUsername@gmail.com"];
    [feed setPassword: @"correctPassword"];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(feedRefreshing:) name:PSFeedRefreshingNotification object:nil];

    [feed refresh:NULL];
}

Expected Results:
No error would be printed

Actual Results:
The error message 

Error Domain=NSURLErrorDomain Code=-1013 "A username and password are required" UserInfo=0x1004164a0 {NSLocalizedDescription=A username and password are required}

is printed instead.

Regression:

Notes:

The feed can be retrieved from Safari as well as by authenticating using a NSURLConnection delegate.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!