“Dotnet tips, SQL Server tips, Silverlight tips, AJAX tips...”
Read Experts reviews and compare prices to find the right desktop or laptop for you from the huge collection.
Some days ago I had to deploy my application into SSL hosting and add Authentication.
I have compiled the issues and solutions that I found, hope that this could save you some headaches
Playing with Silvelright is nice, but… What happens when you convince your boss to do a real development? Suddenly you find you that most of the samples that you have used runs under naïve HTTP and what’s worse they don’t care about security or authentication, even you can be months developing using your cassini under http… but normally that won’t be your real business scenario, isn’t it?
Now, don’t panic :-), It’s possible to use SSL + Authentication on Silverlight? The answer is yes, Does it support all the possible scenarios? The answer is NO.
If you want to use SSL+Auth you have to configure your services as you did on your AJAX application, they must have session enabled, and you get the context information from there (e.g. user logged in), what does this mean? Like in AJAX applications you will have to perform regular pings, or have some service authentication where you can automatically login once the session expires (there are other solutions, but seems complex to me, poor silly dude).
That’s for services, but what about making direct calls to cross domain using WebClient or HttpWebRequest plus Credentials? It is not possible to supply credentials for HTTP auth in SL2 due to limitations in NPAPI. Since this is a cross domain scenario, you would need to tunnel the request through a proxy service on the server first where they would have complete control over the request.
Another issue that you will find, is that, in some scenarios, you will need to have to WCF and IIS knowledge to config… so you will face the devil doubt, Is a Siliverhght issue, is a WCF config issue, or is a IIS issue?
In my case, after some googling and good community help I manage to get my Silverlight + SSL + Authentication up and running, below you will find a compilation of troubleshooters links that I have found in that way, hope to save you some headaches.
General Errors
Not found Error: You attempt to make a call to the service and you get a “Service Not Found” error.
Cross Domain error on Same Domain call
Failed to call SSL
Authentication: you must rely on ASP .net session + Authentication
[ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class MyService
[OperationContract] public EntityAccountsShared GetSharedAccountsForGivenFolder() { // Accesing HTTP Context session content HttpContext.Current(...) (...) }
Other Errors:
Hope this helps.