Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google analytics 向';https://accounts.google.com/o/oauth2/token' 失败。无法连接…目标计算机主动拒绝173.194.70.84:443_Google Analytics_Google Api_Google Analytics Api - Fatal编程技术网

Google analytics 向';https://accounts.google.com/o/oauth2/token' 失败。无法连接…目标计算机主动拒绝173.194.70.84:443

Google analytics 向';https://accounts.google.com/o/oauth2/token' 失败。无法连接…目标计算机主动拒绝173.194.70.84:443,google-analytics,google-api,google-analytics-api,Google Analytics,Google Api,Google Analytics Api,我正在构建一个应用程序,通过谷歌分析获取数据。为此,我从Google API控制台创建了一个服务帐户信息,并在.NET webform应用程序中通过以下代码成功获取数据: string clientEmailId = ConfigurationManager.AppSettings.Get("clientEmailId"); string keyFile = AnalyticsKeyFileInitialPath + ConfigurationManager.AppSettings.Get("k

我正在构建一个应用程序,通过谷歌分析获取数据。为此,我从Google API控制台创建了一个服务帐户信息,并在.NET webform应用程序中通过以下代码成功获取数据:

string clientEmailId = ConfigurationManager.AppSettings.Get("clientEmailId");
string keyFile = AnalyticsKeyFileInitialPath + ConfigurationManager.AppSettings.Get("keyFile");
string keyPass = ConfigurationManager.AppSettings.Get("keyPass");
var desc = GoogleAuthenticationServer.Description;
var key = new X509Certificate2(keyFile, keyPass, X509KeyStorageFlags.Exportable);
var client = new AssertionFlowClient(desc, key) { ServiceAccountId = clientEmailId, Scope = scopeUrl };
var auth = new OAuth2Authenticator<AssertionFlowClient>(client, AssertionFlowClient.GetState);
var gas = new AnalyticsService(new BaseClientService.Initializer
{
    Authenticator = auth
});
//auth.LoadAccessToken();
var accounts = gas.Management.Accounts.List().Fetch();
string clientEmailId=ConfigurationManager.AppSettings.Get(“clientEmailId”);
字符串keyFile=AnalyticsKeyFileInitialPath+ConfigurationManager.AppSettings.Get(“keyFile”);
字符串keyPass=ConfigurationManager.AppSettings.Get(“keyPass”);
var desc=GoogleAuthenticationServer.Description;
var key=new X509Certificate2(keyFile、keyPass、x509keystargeflags.Exportable);
var client=newassertionflowclient(desc,key){ServiceAccountId=clientEmailId,Scope=scopeUrl};
var auth=new OAuth2Authenticator'失败。
内部异常:无法建立连接,因为目标计算机主动拒绝它173.194.70.84:443


你知道我做错了什么吗?

这是我观察到的最奇怪的行为。当我在调用程序的端点中使用use Visual Studio Development Server生成的url时,它的工作方式很有魅力。但当我在IIS中使用虚拟目录或Web应用程序并放入该地址时,它会抛出相同的错误。知道问题出在哪里了吗?找出原因是开发人员机器上的防火墙问题。仍然无法确定我将删除哪个特定的限制,这样我就不会面临这个问题[不想整体删除防火墙限制]