Web request to 'https://accounts.google.com/o/oauth2/token' failed. No connection could be made because the target machine actively refused it 173.194.70.84:443

246 views
Skip to first unread message

sullol...@gmail.com

unread,
May 15, 2013, 6:04:13 AM5/15/13
to google-analytics...@googlegroups.com
I am building application to fetch data via google analytics. For that purpose i have created Service account information from google API console and in my .net webform appliation successfully able to fetch data via follwoing code

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();

Now i am calling same code via WCF service but getting following error Exception Message: Unable to connect to the remote server Inner Exception: Web request to 'https://accounts.google.com/o/oauth2/token' failed. Inner Exception: No connection could be made because the target machine actively refused it 173.194.70.84:443

Any idea what i could be doing wrong

Reply all
Reply to author
Forward
Message has been deleted
0 new messages