我已经在我的网站上实现了几个谷歌API - 以禁止联系人导入和YouTube上传。当在本地(在我自己的开发服务器的本地主机下)一切正常工作时,使用它们通过站点(HostGator和1and1托管,我在任何地方都收到相同的错误)有一些问题 - 似乎是 身份验证问题。ASP.NET网站授权问题与谷歌和YouTube的API
该网站是在ASP.NET 2.0,这些都是错误的MSG我得到:
错误的谷歌联系人(使用AuthSub) - 这种情况发生后,我顺利地收到来自谷歌的的AuthSub会话令牌:
The remote server returned an error: (401) Unauthorized. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.WebException: The remote server returned an error: (401) Unauthorized. Source Error: Line 493: ContactsQuery query = new ContactsQuery(ContactsQuery.CreateContactsUri("default")); Line 494: Line 495: ContactsFeed feed = service.Query(query); Line 496: Line 497: ArrayList emails = new ArrayList(); Source File: d:\inetpub\vhosts\e-koren.com\httpdocs\home-cooking\EmailInvite.aspx.cs Line: 495
错误为(是使用ClientLogin)的YouTube视频上传:
Invalid credentials Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: Google.GData.Client.InvalidCredentialsException: Invalid credentials Source Error: Line 71: // try Line 72: // { Line 73: FormUploadToken _token = request.CreateFormUploadToken(newVideo); Line 74: Line 75: actionURL.Value = _token.Url + "?nexturl=" + Server.UrlPathEncode(Request.Url.ToString()+"?uuc="); Source File: d:\inetpub\vhosts\e-koren.com\httpdocs\home-cooking\youtubeUpload.aspx.cs Line: 73
任何人都知道它会是什么?
感谢, 阿萨夫