It’s already a long time ago I wrote some articles about the missing feature of passing credentials while doing a WebRequest, WebClient or WCF call. We now have ourselves Silverlight 3 Beta, it looks like we’re getting support for Credentials at last.
I can now write the following code which is seen as valid. It compiles as well…
var webClient = new WebClient();
webClient.Credentials =
new NetworkCredential("Administrator", "p@ssw0rd");
webClient.DownloadStringCompleted +=
webClient_DownloadStringCompleted;
webClient.DownloadStringAsync(
new Uri("SomeData.xml", UriKind.Relative));
Not yet, sadly. Right now we will get an exception…
The inner exception is a NotImplementedException.
{System.NotImplementedException: This property is not implemented by this class.
at System.Net.WebRequest.set_Credentials(ICredentials value)
at System.Net.WebClient.GetWebRequest(Uri address)
at System.Net.WebClient.DownloadStringAsync(Uri address, Object userToken)}
What does this mean? We don’t know anything yet. The only thing we can do is speculate about a feature coming in Silverlight 3, Credentials for WebRequests. I could find the usage of ICredentials inside WebRequest and WebClient. It’s not near implementation in WCF Clients yet, but we can hope for this to be implemented as well.
May 12th, 2009 at 20:59
[...] We all know it’s not possible yet to provide credentials when calling WCF Service. I’m telling yet, because I saw some signs that we might get support for credentials. [...]
May 13th, 2009 at 06:40
[...] We all know it’s not possible yet to provide credentials when calling WCF Service. I’m telling yet, because I saw some signs that we might get support for credentials. [...]
July 11th, 2009 at 20:22
[...] A few months ago, I investigated Silverlight 3 Beta on support for Credentials. [...]
December 2nd, 2009 at 21:21
[...] March 2009 – Silverlight 3 – WebClient, WebRequest and WCF calls using Credentials? [...]