Hi, Anyone that sees this post. I ended up solving the problem by using a solution in another post. Seems like some ridiculous hoops to jump through but it has been running successfully for over a month now. Link to other post:
https://groups.google.com/forum/#!topic/google-picasa-data-api/i3Lz6gXYtwc Ben On Friday, 29 May 2015 16:03:39 UTC+1, Ben Donovan wrote: > > I have been using the picasa client login for a couple of years without > issue. We use it to store photos that users upload so we do not want to > request for user authentication as we are just storing the photos in our > own account. It is developed in .NET. > > > > Up until today it has worked and I can’t work out (and beginning to wander > whether it is now possible) how to fix the issue. > > > > *Previous Code:* > > > > PicasaService service = new PicasaService("My App"); > > service.setUserCredentials("[email protected]", "password"); > > > > Uri postUri = new Uri(PicasaQuery.CreatePicasaUri("default", AlbumID)); > > string sContentType = "image/jpeg"; > > > > > > PicasaEntry entry = (PicasaEntry)service.Insert(postUri, fileStream, > sContentType, sFilename); > > > > fileStream.Close(); > > > > sPicasaURL = entry.Media.Content.Url.ToString(); > > > > *NEW CODE (that doesn’t work!)* > > > > Uri postUri = new Uri(PicasaQuery.CreatePicasaUri("default", AlbumID)); > > > > const string ServiceAccountEmail = "[email protected]"; > > > > var certificate = new X509Certificate2(HttpContext.Current.Server.MapPath( > "bin/key2.p12"), "notasecret", X509KeyStorageFlags.Exportable); > > > > var serviceAccountCredentialInitializer = new ServiceAccountCredential. > Initializer(ServiceAccountEmail) > > { > > Scopes = new[] { " > https://picasaweb.google.com/data/" } > > }.FromCertificate(certificate); > > > > var credential = new ServiceAccountCredential > (serviceAccountCredentialInitializer); > > > > if (!credential.RequestAccessTokenAsync(System.Threading.CancellationToken > .None).Result) > > throw new InvalidOperationException("Access token > request failed."); > > > > var requestFactory = new GDataRequestFactory(null); > > requestFactory.CustomHeaders.Add("Authorization: Bearer " > + credential.Token.AccessToken); > > > > > > PicasaService service = new PicasaService("My App" > ... -- You received this message because you are subscribed to the Google Groups "Google Picasa Web Albums API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-picasa-data-api. For more options, visit https://groups.google.com/d/optout.
