我正在使用 Picasa 网络相册数据 API 从 WPF 应用程序访问用户的相册。
我遵循了位于此处的代码: http ://code.google.com/apis/gdata/clientlogin.html
我使用 Google Apps(托管)帐户创建了 Picasa 网络相册帐户。每当我尝试使用 WPF 应用程序登录时,都会返回“BadAuthentication”错误代码。
希望有人知道我做错了什么。请注意,这在我使用普通 Google 帐户登录时有效。
这是我的代码片段:
GDataGAuthRequestFactory authFactory = new GDataGAuthRequestFactory("lh2", _appName);
authFactory.AccountType = "HOSTED_OR_GOOGLE";
_picasaService = new PicasaService(authFactory.ApplicationName);
_picasaService.RequestFactory = authFactory;
_picasaService.setUserCredentials(username, password);
return _picasaService.QueryAuthenticationToken();