How do I configure authentication in Silverlight-Enabled WCF Web Service?
The best way for me is form authentication ... using ASP.NET apps.
Basically you open 3 * .svc files in your WCF service that handle authentication, roles and profiles. No code because it is built in .net assemblies. You will need to do some customization in the .config (see link) to enable them.
Side note on ASPNETDB.MDF
Usually all user accounts and profiles are in ASPNETDB.MDF, which is in a local file in the APP_Data folder, but I find this clumsy, especially with permissions, so I saved it to my main WCF database, but you can choose different if you have a connection string. To initialize it, I ran "C: \ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ a spnet_regsql -C * Data Source = localhost; Home Directory = MYDB; Persist Security Info = True; User ID = **; Password = ****; "* -A all" to include ASP.NET membership tables and sprocs in db of my choice. If you do, then ... you can override the default LocalSQLServer connection string or it won't find db. like this in the web.config of your asp.net website.
<ConnectionStrings> <transparent /> <add name = "LocalSQLServer" connectionString = "Data Source = localhost; Home Directory = MYDB; Persist Security Info = True; User ID = **; Password = ****;" providerName = "System.Data.SqlClient" />
Actually add user accounts and roles
1) from Visual Studio 2) Click on your ASP.NET website. 3) There should be a menu above named Website that shows ... select ASP.NET configuration and your browser will start with the configuration website, which will edit your configuration and update the configured database with accounts and roles.
I hope this helps
a source to share