Friday, November 19, 2010

Using ASP.NET authentication in Silverlight with RIA Services

The first step is to set up the database you wish to authenticate against (ignore this if you are using Windows authentication, which wouldn't apply for most websites).

If you are not using the default DB, add this to the configuration section in your web.config:

<connectionStrings>
    <clear/>
    <add name="LocalSqlServer" connectionString="data source=(local); Integrated Security=SSPI;Initial Catalog=ASPNET;" providerName="System.Data.SqlClient" />
</connectionStrings>

(Thanks to centricle.com for the html encoding utility.)

To add the default ASP.NET authentication tables to the database, use aspnet_regsql.

asp.net has a good introduction to setting up ASP.NET authentication.

This blog entry shows how to modify the silverlight business templates to use ASP.NET forms authentication with "stay logged in" feature.

0 comments:

Post a Comment