Monday, August 27, 2012 4:59 AM
I have a Windows 8 Application running behind the proxy and it throwing the exception "Proxy authentication required (407)."
Tried the solutions specified in the following thread, with no use
I am trying to read some RSS feed and display to the UI using the following Code snippet
SyndicationClient client=new SyndicationClient();
SyndicationFeed feed=await client.RetrieveFeedAsync(feedUri);
This Code passes and displays the information sometimes; but most of the times it failed with the Proxy exception.
How can I ask the user for authentication?
When we Open the built-in News App or Finance App, it is asking the User to enter Proxy details and connecting to internet. How can I achive the same? If the App fails to authenticate the proxy, prompt the user to enter details [like built-in apps] and once the suer enters the details, try to connect to internet using the entered details.
Thanks in Advance
Monday, August 27, 2012 5:55 PM
You can use CredentialPicker then get ID and password by CredentialPickerResult
Once you get it, use CredentialCache to create an ICredential
CredentialCache myCache = new CredentialCache(); myCache.Add(new Uri("http://my-proxy:my-port"),"Basic",new NetworkCredential(ID,Password));
then assign to the handler credential:
handler.Proxy.Credentials = myCache;
If you have any further question, feel free to contact me
Tuesday, August 28, 2012 4:46 AM
Thanks Emi Smith.
Proxy detection issue is resolved by enabling the "Internet (Client & Server)" capability. Earlier Internet (Client) was enabled.
Prompting the user for proxy credentials will be done using your suggestion.
- Marked As Answer by Ambily Tuesday, August 28, 2012 4:46 AM
Sunday, September 02, 2012 5:45 AMWhere is this 'Capabilities' window found ?
Sunday, September 02, 2012 6:35 AMYou should double click on the file 'Package.appxmanifest' [for your main project] in the Solution Pane. Then click on 2nd tab.