views:

481

answers:

2

My website uses Forms authentication. I did silverlight 3 module which is designed to work in context of asp - authenticated user. Silverlight module talks with WCF hosted by the same asp.net website, but the issue is that it cannot authenticate to WCF service. I run Fiddler and I see that .ASPXAUTH cookie is not sent to WCF service. How to force Silverlight to get this cookie from browser and send it to service?

A: 

I've used it successfully. First, I make sure that there are is a service endpoint for the WCF AuthorizationService used by ASP.NET. Then use the Silverlight project to generate a "Service Reference" to the AuthorizationService. Finally, in your module, you will use that service reference to login your visitor using their credentials stored within your provider. If you have some more information on how you've built your site, I might be able to offer a more concise answer to your problem.

Rick
User logs in asp.net website. Then he can enter Silverlight module. I dont want user to log in again in Silverlight and I also don't want to store his password in any temporary place (brower/session)
tomo
They are one and the same. Logging into a page that uses Forms Authentication would create the same cookie as using WPF Authentication Service. So logging into the page would allow pass through to Silverlight just as logging into Silverlight would allow pass through to ASP.NET. btw, the Password is never stored anywhere using Forms Authentication.
Rick
Why I need to add reference to Authentication Service? Do I need to call any function (or configure something) from this service inside silverlight client?
tomo
If I explicity set cookie in my WCF method (FormsAuthentication.SetAuthCookie(login, true);), then all works. If cookie is set in asp.net application then it's not visible for silverlight
tomo
A: 

Finally I solved it. The problem of missing cookie was made by inproper host name. I was sending asp.net requests to myhostname, but SL was calling WCF using myhostname.mylocaldomainnam.local. This is why there was no .aspauth cookie during WCF calls.

tomo