locked
System.Net.HttpListenerException: Access is denied RRS feed

  • Question

  • User588019485 posted

    When i am trying to access my website hosted on windows azure, i get this error message. please see the stack trace below. I am using HttpClientInitializer in my project to access google analytic services. 

    [HttpListenerException (0x5): Access is denied]
       System.Net.HttpListener.SetupV2Config() +333
       System.Net.HttpListener.Start() +297
       Google.Apis.Auth.OAuth2.<ReceiveCodeAsync>d__6.MoveNext() +188
       System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
       System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
       Google.Apis.Auth.OAuth2.<AuthorizeAsync>d__8.MoveNext() +540
       System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
       System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
       Google.Apis.Auth.OAuth2.<AuthorizeAsync>d__4.MoveNext() +395
       System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
       System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
       Google.Apis.Auth.OAuth2.<AuthorizeAsync>d__1.MoveNext() +268
    

    Tuesday, May 17, 2016 7:24 AM

All replies

  • User-1636183269 posted

    Make sure iis has access the website.

    http://www.daimto.com/google-calendar-api-authentication-with-c/

    Tuesday, May 17, 2016 7:30 AM
  • User588019485 posted

    I get this error after i authenticate the website . Also what IIS you are referring ? its hosted on azure 

      var credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets
                    {
                        ClientId = "1016684719145-...............",
                        ClientSecret = "YoXhZTZ6C................"
                    },
    
                    new[] { 
                        AnalyticsService.Scope.Analytics, 
                        AnalyticsService.Scope.AnalyticsEdit, 
                        AnalyticsService.Scope.AnalyticsManageUsers, 
                        AnalyticsService.Scope.AnalyticsManageUsersReadonly, 
                        AnalyticsService.Scope.AnalyticsProvision, 
                        AnalyticsService.Scope.AnalyticsReadonly },
                    "ispy.analytics@radiusinteractive.com",
                    CancellationToken.None,
                    new FileDataStore("Analytics.Auth.Store")).Result;
    
    
                    if (credential != null)
                    {
                        service = new AnalyticsService(new BaseClientService.Initializer
                        {
                            HttpClientInitializer = credential,
                            ApplicationName = "iSPY Stats"
                        });
    
                        profileId = getFirstProfileId(service);
                    }

    Tuesday, May 17, 2016 7:40 AM
  • User-867830690 posted

    Please have a look at this thread: http://stackoverflow.com/questions/29849751/azure-websites-denies-access-to-google-api, it has the same issue with you. hope it helps. 

    Wednesday, May 18, 2016 2:47 AM