2013-06-28 49 views
0

我正尝试使用Xamarin在Android手机上使用.NET API上传视频。我无法验证,并在主题行中出现错误。下面是从Xamarin代码:我用HttpScoop您必须经过身份验证才能发出请求 - GoogleAuthenticator

https://github.com/xamarin/google-apis/blob/master/src/Android/Google.Apis.Android/Apis/Authentication/GoogleAuthenticator.cs

而且似乎也没有网络流量。

我使用的Web应用程序ID:

客户端ID为Web应用程序

客户端ID:

* .apps.googleusercontent.com

邮箱地址:

* @ developer.gserviceaccount.com

客户秘密:

- *

重定向的URI:http://jmawebtechnologies.com

JavaScript来源:http://jmawebtechnologies.com

这里是我创建谷歌身份验证者:

GoogleAuthenticator Auth() 
{ 
return new Google.Apis.Authentication.OAuth2.GoogleAuthenticator (ClientID, new Uri ("http://jmawebtechnologies.com"),                  Google.Apis.Youtube.v3.YoutubeService.Scopes.YoutubeUpload.ToString()); 
} 
+1

您可以运行提琴手或类似的东西,我们可以看到您发送到服务器的确切请求吗? – peleyal

+0

我确实运行过它。似乎没有交通。查看我的新请求图片。 –

回答

0

我发现我必须调用GetUI。这会打开用户登录Google的浏览器窗口。

StartActivity(auth2.GetUI (this)); 

        auth2.Completed += (sender, eventArgs) => { 


         if (eventArgs.IsAuthenticated) { 
          MakeAlert("Is auth", "Accepted!"); 
         } else { 
          // The user cancelled 
          MakeAlert("Is not auth", "failure"); 
         } 
        }; 
+0

嘿,你有没有得到auth2。你能发布auth2代码吗?谢谢 – senzacionale