hoangduit / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

Error authenticating to Youtube #422

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi there!
I'm having a problem authenticating to You Tube in my Web Application.
While trying to upload a video the following error occurs:

------------------------------------
Error authenticating (check service name): Unknown
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.AuthenticationException: Error
authenticating (check service name): Unknown

Stack Trace:

[AuthenticationException: Error authenticating (check service name):
Unknown]

Google.GData.Client.GDataGAuthRequest.QueryAuthToken(GDataCredentials
gc) +1027
   Google.GData.Client.GDataGAuthRequest.EnsureCredentials() +43
   Google.GData.Client.GDataRequest.EnsureWebRequest() +1021
   Google.GData.Client.GDataGAuthRequest.EnsureWebRequest() +26
   Google.GData.Client.GDataGAuthRequest.CopyRequestData() +50
   Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter)
+457
   Google.GData.Client.GDataGAuthRequest.Execute() +10
   Google.GData.Client.MediaService.EntrySend(Uri feedUri, AtomBase
baseEntry, GDataRequestType type, AsyncSendData data) +541
   Google.GData.Client.Service.Insert(Uri feedUri, AtomEntry newEntry,
AsyncSendData data) +79
   Google.GData.Client.Service.Insert(Uri feedUri, TEntry entry) +58
   Google.GData.YouTube.YouTubeService.Upload(String userName,
YouTubeEntry entry) +98
   Google.YouTube.YouTubeRequest.Upload(String userName, Video v) +41
   Google.YouTube.YouTubeRequest.Upload(Video v) +8
   Entidades.Videos.Insert(String pGoogleDeveloperKey, String
pYouTubeUser, String pYouTubePass, Stream pFileStream, String
pFileName, String pContentType) in E:\GEN\Camargo Alfaiataria\Sistema
\Entidades\Videos.cs:95
   Admin.Videos.Editar.btnGravar_Click(Object sender, EventArgs e) in
E:\GEN\Camargo Alfaiataria\Sistema\Admin\Videos\Editar.aspx.cs:126
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +112

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBa
ckEvent(String
eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+36
   System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+5563
------------------------------

My code in C#:

YouTubeRequestSettings ytRSettings = new YouTubeRequestSettings("My
Video", "clientiddummie", pGoogleDeveloperKey, pYouTubeUser,
pYouTubePass);
YouTubeRequest ytRequest = new YouTubeRequest(ytRSettings);

Video ytVideo = new Video();

ytVideo.Title = _Title;
ytVideo.Tags.Add(new MediaCategory("Travel",
YouTubeNameTable.CategorySchema));
ytVideo.Keywords = _Keywords;
ytVideo.Description = _Description;
ytVideo.YouTubeEntry.Private = false;

ytVideo.YouTubeEntry.MediaSource = new MediaFileSource(pFileStream,
pFileName,pContentType);

Video createdVideo = ytRequest.Upload(ytVideo);
----------------------------------

I posted this issue to the YouTube APIs Developer Forum and they suggested 
posting it here.

Any help?
Tks! 

Original issue reported on code.google.com by eduardo....@gmail.com on 1 Sep 2010 at 2:51

GoogleCodeExporter commented 9 years ago
Version 1.6 of the client library fixed the issue as reported in the forum:

http://code.google.com/intl/it/apis/youtube/forum/discussion.html?place=topic%2F
youtube-api-gdata%2FHPossPz3gYw%2Fdiscussion

Original comment by ccherub...@google.com on 4 Feb 2011 at 3:04