Picasa ClientLogin deprecation issues

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("myemail@gmail.com", "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 using Auth2 (that doesn’t work!) - I have gone onto the developer console and set up a client ID. I am using the P12 key in my application generated there to get the access code.

Uri postUri = new Uri(PicasaQuery.CreatePicasaUri("default", AlbumID));

const string ServiceAccountEmail = "email@developer.gserviceaccount.com";

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");
            service.RequestFactory = requestFactory;

string sContentType = "image/jpeg";

PicasaEntry entry = (PicasaEntry)service.Insert(postUri, fileStream, sContentType, sFilename);

fileStream.Close();

sPicasaURL = entry.Media.Content.Url.ToString();

Can anyone help?

I simply get :

"The remote server returned an error: (404) Not Found." error. {"Execution of request failed: https://picasaweb.google.com/data/feed/api/user/default/albumid/myalbumid"}

Is this type of login even now possible with the clientlogin deprecated?

Thanks in advance!

you need to check the new OAuth2 Authentication Protocol that google enabled 2 days ago.

The ClientLogin API is deprecated and does not work anymore...

I am currently working on solving the same issue and will post my sample Java Code with comments soon.

Cheers, Gizmo

Picasa ClientLogin deprecation issues - c# - csharp, 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  las794 - I tried to uninstall and reinstall picasa again on the 19th and it then came up with a windows trouble shooting box when I tried to import from my camera. I was able to work through this and choose Windows 8 as the default to open Picasa. I first time I uninstalled and reinstalled picasa I did not get a trouble shooting box to work with.

This has worked well:

public object GetGoogleApiAccessToken(IEnumerable<string> scopes, string mapPath)
{
    try
    {
        var keyFilePath = mapPath + WebConfigurationManager.AppSettings["keyFilePath"];

        // found in developer console
        var serviceAccountEmail = WebConfigurationManager.AppSettings["serviceAccountEmail"];

        var certificate = new X509Certificate2(keyFilePath, "notasecret", X509KeyStorageFlags.Exportable);

        var credential =
            new ServiceAccountCredential(new ServiceAccountCredential.Initializer(serviceAccountEmail)
                //create credential using certificate
            {
                Scopes = scopes
            }.FromCertificate(certificate));

        credential.RequestAccessTokenAsync(CancellationToken.None).Wait(); //request token

        return credential.Token.AccessToken;
    }
    catch (Exception err)
    {
        Debug.WriteLine(err.Message);

        return null;
    }
}

HTTP Client Task:

private static async Task<string> RunRequest(Uri uri, object token)
    {
        using (var httpClient = new HttpClient())
        {
            try
            {
                httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer",
                    token.ToString());
                httpClient.DefaultRequestHeaders.Add("GData-Version", "2");

                var response = await httpClient.GetAsync(uri);

                var content = await response.Content.ReadAsStringAsync();

                if (response.StatusCode == HttpStatusCode.Forbidden)
                    throw new Exception(response.StatusCode.ToString());

                if (!response.IsSuccessStatusCode) return null;

                var jsonStr = await response.Content.ReadAsStringAsync();

                return jsonStr;
            }
            catch (Exception err)
            {
                Debug.WriteLine(err.Message);

                return err.Message;
            }
        }
    }

Then we use it like this:

var urlStr = string.Format("https://picasaweb.google.com/data/feed/api/user/{0}/albumid/{1}?alt=json",
GoogleUserId, albumID);

var uri = new Uri(urlStr);    

var jsonStr = await RunRequest(uri, accessToken);

c# - Picasa ClientLogin deprecation issues -, i have been using picasa client login couple of years without issue. use store photos users upload not want request user authentication storing photos in our own  Google will shut down ClientLogin (see: https://developers.google.com/accounts/docs/AuthForInstalledApps?csw=1). This method should be deprecated in favour of of oAuth2.

GET https://picasaweb.google.com/data/feed/api/user/userID?deprecation-extension=true

"deprecation-extension": "true"

Mark this library as 'not maintained' · Issue #54 · google/gdata , An example is: Google Search: google photos api -> picasa api -> docs ClientLoginFailed: Server responded to ClientLogin request: 404'). a change to the README.md file, to make it clearer that this is deprecated code. Picasa can’t send pictures thru AOL email because Picasa doesn’t know what the default mail client is. Take a look at the registry per this doc and let me know what I need to do in order to accomplish the aforementioned.

How to use Google OAuth2 in place of picasaService , My Java application had been uploading photos to Picasa Web albums. derrenbrown opened this issue on Jun 2, 2015 · 1 comment Yes, setUserCredentials used ClientLogin, which has been deprecated for a while and is now disabled. One that had been fully tested is Picasa. There are several issues when I try to use ClientLogin mechanism in PHP : The application doesn't know the SSL key and if we can add it dynamically, it will be limited if you are using shared host environment.You have to construct your own HTTP header as authentication process part.

What's happening to Picasa, Picasa Web Albums, and the Picasa , In January 2019, we will deprecate the Picasa Web Albums Data API and the Picasa Slideshow Widget. Apps that integrate with the API will stop working. The Picasa database is where Picasa keeps an index of all your pictures and videos along with information and thumbnails from all folders and pictures being scanned by Picasa. Rebuilding the database is the process of purging the database of damaged or incorrect information and then rebuilding the information.

google-picasa-data-api, Teri Brooks; 2016/02/23 [PWA API] Is the Picasa Web Album API eventually going to Mark Steger; 2015/06/07 [PWA API] Re: ClientLogin deprecation issues  We’ve decided to retire Picasa in order to focus on a single photo service in Google Photos – a new, smarter photo app that works seamlessly across mobile and the web. Where can I find my photos? If you have photos or videos in a Picasa Web Album, the easiest way to still access, modify and share most of that content is to log in to Google

Comments
  • Just a quick note I have created a service account Client ID in the developers console and this is the one I am using in my application.
  • I am struggling with the same issue. I am now getting an access token with Oauth2 but not sure how to use it with the original .NET Google Picasa API, the Google.GData.Photos assembly.
  • @kstubs, could you post your code to get the access token please. I think I have figured out the second part but I am struggling to get the access token. Are you using a service account or a web application account to get the access token? I used the outh2 playground to generate a temp access token and was able to use this successfully in my code to post a photo into my picasa album. I will happily post the complete working code if you can help me out with the first part! Thanks.
  • I upgraded to google for business. The instructions I was reading suggested that in order to use Service accounts you had to grant domain access to your google drive folders; which is a feature of Google for business. It's unclear to me that service accounts work as prescribed otherwise. Additionally, I've moved on from the Picasa .Net api (couldn't find a version supporting OAuth2).
  • @kstubs thanks for your reply. I have tried googling this and can't find this anywhere. Can you remember where you read this? A link would be great. Thanks again for your help.
  • Thanks for your response. I will look forward to your code. I think the Java GData Core library for Java is better than .NET as there appears to be no setOAuth2Credentials available.
  • I think this is actually meant to be an answer. But the phrasing makes it seem at first glance like a question. Would you like to rephrase to avoid this impression? You could improve by adding more explanation of how it solves the problem. If it actually IS a question, please turn it into an "official" one, by using the "Ask Question" button on the top right of the page, then delete this post.