我已經在我的網站上實現了幾個谷歌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
任何人都知道它會是什麼?
感謝, 阿薩夫