CSLA Silverlight ASP.NET Forms Authentication and needing cookie pass-through to client

CSLA Silverlight ASP.NET Forms Authentication and needing cookie pass-through to client

Old forum URL: forums.lhotka.net/forums/t/9412.aspx


Adam posted on Friday, August 20, 2010

CSLA Silverlight ASP.NET Forms Authentication and needing cookie pass-through to client
Hi,
We have a CSLA Silverlight application with ASP.NET Forms Authentication (logon page and all of app is in Silverlight).  Authentication (and authorisation) works.
We have extended our application to include some reports, using  SSRS 2008 R2 with custom ASP.NET Forms Authentication.  These reports work via an asp.net logon test page.
We now need to couple these two together, which we believe we can achieve by using an ASP.NET Forms authentication cookie.  We have made changes to the web.config files, but a cookie is never present on the Silverlight side and so we cannot authenticate the logged in user for reports.
Has anyone out there managed to do something similar and get a cookie in the Silverlight side?  Any help would be much appreciated. 
We have tried several variations in web.config files, currently the authentication section in both the application WCF web.config and application web web.config are the same as follows:

<authentication mode="Forms">
      <forms     name="sqlAuthCookie"
          loginUrl="MSA.aspx"
          protection="All"
          timeout="60"
          path="/" />
    </authentication>
    <machineKey validationKey=" ... "
          decryptionKey=" ... "
          validation="SHA1" />
    <!-- Deny anonymous user-->
    <authorization>
      <deny users ="?" />
      <allow users = "*" />
    </authorization>
   
Can anyone advise please?

Adam

Just to note I am using SL 3.5, CSLA 3.7, SSRS 2008 R2, IIS7

tmg4340 replied on Friday, August 20, 2010

Are you creating the Forms cookie in your SL app?  I think you need to get your SL app to write the Forms Authentication cookie.  Then you should be good to go.

It's an older post, relating to Silverlight 2, but it should still work:

http://interviews.dotnetthread.com/2009/02/implementing-forms-authentication-in.html

HTH

- Scott

Adam replied on Monday, August 23, 2010

Thanks Scott this was exactly what I needed :)

Kind Regards

Adam Perkins

www.flexiblesoftwaresolutions.co.uk

Copyright (c) Marimer LLC