Je parviens à obtenir le SID (SessionID) de mon compte Google Reader. Pour obtenir le flux et effectuer d'autres opérations dans Google Reader, vous devez obtenir un jeton d'autorisation. J'ai du mal à faire ça. Quelqu'un peut-il jeter un peu de lumière?API Google Reader avec Objective-C - Problème d'obtention du jeton
//Create a cookie to append to the GET request
NSDictionary *cookieDictionary = [NSDictionary dictionaryWithObjectsAndKeys:@"SID",@"NSHTTPCookieName",self.sessionID,@"NSHTTPCookieValue",@".google.com",@"NSHTTPCookieDomain",@"/",@"NSHTTPCookiePath",nil];
NSHTTPCookie *authCookie = [NSHTTPCookie cookieWithProperties:cookieDictionary];
//The URL to obtain the Token from
NSURL *tokenURL = [NSURL URLWithString:@"http://www.google.com/reader/api/0/token"];
NSMutableURLRequest *tokenRequest = [NSMutableURLRequest requestWithURL:tokenURL];
//Not sure if this is right: add cookie to array, extract the headers from the cookie inside the array...?
[tokenRequest setAllHTTPHeaderFields:[NSHTTPCookie requestHeaderFieldsWithCookies:[NSArray arrayWithObjects:authCookie,nil]]];
//This gives me an Error 403 Forbidden in the didReceiveResponse of the delegate
[NSURLConnection connectionWithRequest:tokenRequest delegate:self];
Je reçois une erreur 403 Forbidden comme réponse de Google. Je ne le fais probablement pas correctement. Je définis les valeurs du dictionnaire en fonction de la documentation de NSHTTPCookie.
OMG VOUS ÊTES MON SAUVEUR – Justin