Forms authentication in Silverlight

Posted by Matt on Stack Overflow See other posts from Stack Overflow or by Matt
Published on 2010-03-18T21:45:46Z Indexed on 2010/03/18 21:51 UTC
Read the original article Hit count: 634

I have a website using forms authentication. Everything runs sweet their. I've got a Silverlight app that uses Duplex messaging to talk to a WCF service. I'd like to be able to authenticate users in my service.

I realize that by doing this

<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />

that my service would then have access to the HttpContext.Current context and I could easily authenticate a user.

But herein lies the problem.

aspNetCompatibilityEnabled="true" combined with Duplex messaging results in very, very, very slow communication between silverlight and the website (10 seconds or more). Unless I have a configuration wrong, I'm going to assume that this is a bug in WCF / Silverlight.

So basically I'm looking for a workaround. One idea I wanted to try was to read the ASPSESSID cookie from the browser and send that value over the wire. But I don't know what to do with the cookie on the service side.

Is there some way to authenticate a user by sending their cookie data over duplex messaging?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about forms-authentication