Question

I am trying to configure ios push notifications on Azure Notification hubs. I know I have everything done right because I have done this before and I have a checklist. But for some reason it's failing without any logical explanation. The error I get is

The remote server returned an error: (407) Proxy Authentication Required..TrackingId:b12dc955-b24f-42f9-acc4-3440c4d60ab4,TimeStamp:03/04/2014 10:48

And StackTrace

Exception rethrown at [0]: 
at Microsoft.ServiceBus.Common.ExceptionDispatcher.Throw(Exception exception)
at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
at Microsoft.ServiceBus.Messaging.ServiceBusResourceOperations.EndGetAll(IAsyncResult asyncResult, String& continuationToken)
at Microsoft.ServiceBus.NamespaceManager.EndGetRegistrationsByTag(IAsyncResult result)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at RD8MobileApp.Api.Services.PushNotificationService.<RegisterForNotifications>d__1.MoveNext() in c:\Development\TFS\RD8\MobileApp.Api\Services\PushNotificationService.cs:line 29

Can anyone help?

Was it helpful?

Solution 2

My guess is that you are sitting behind an HTTP proxy (maybe a firewall) which wants you to authenticate before letting you through to the actual Azure Notification Hub. You may have to set the credentials for the proxy on the Notification Hub client API -- I am not quite sure how to do that but I hope the documentation can point you in the right direction.

Henrik

OTHER TIPS

I think Henrik is right.

You must be behind a proxy server that is requiring authentication information.

You can add the following code ...

WebRequest.DefaultWebProxy = new WebProxy("http://proxyserveraddress:port");
WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultNetworkCredentials;

and then you would be able to send the notification through the API.

I use the credentials of the current user, but you could create custom NetworkCredentials.

Hope it helps.

Javier

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top