Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry Push Development

ERROR HttpPushWorker [] - Push Failed The remote server returned an error: (407) Proxy Authentication Required. Exception: System.Net.WebException

by Retired on ‎05-09-2014 11:31 AM (1,135 Views)

Symptoms

When attempting a server side push from a .Net application, an error 407 Authentication Required Exception is returned. 

Diagnosis

Some machines are setup behind a proxy server and require authentication. The proxy object within your push application does not inherently supply the credentials of the currently logged in user and therefore the proxy refuses access. 

Solution

Add the below element to your .config file 

<system.net>
    <defaultProxy useDefaultCredentials="true"> </defaultProxy>
</system.net>

 

Within your code, Obtain the proxy of your default browser and assign default credentials of the current logged in user before making your HTTPWebResponse Call.

 

IWebProxy myProxy = myWebRequest.Proxy;

                    if (myProxy != null)

                    {

                        myProxy.Credentials = CredentialCache.DefaultCredentials;

                    }

 

Contributors
Users Online
Currently online: 20 members 799 guests
Please welcome our newest community members: