Silverlight RIA Services Active Directory Directory

Hi i am new to ria services and i am trying to change login from SQL to active directory and use login form i am using Silverlight business application template as base. I have the ADmembership provider installed on the website, but how can I get Silverlight to use it?

+2


a source to share


1 answer


This blog post has an answer. Silverlight with WCF Ria Service Services and Active Directory Roles . Thanks Dan for this post!

I'm using Silverlight 4, so a few things have changed since this post. I also used the business application template for this project.

Step 1. This has already been set in the BussinessApplication template in the App.xaml.cs code. You need to comment out the line with webContext.Authentication = new FormsAuthentication();

and uncomment the line webContext.Authentication = new WindowsAuthentication();

.

Step 2. No changes. Add <authentication mode="Windows"/>

to web.config under the /configuration/system.web element.



Step 3. RiaContex is now a WebContext, so change that in the example. The first line to load the user was RiaContext.Current.Authentication.LoadUser(this.Application_UserLoaded, null);

already in the code.

Step 4. No changes. add <roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider"/>

to web.config under the /configuration/system.web element.

With these small changes, the Silverlight application connected to Active Directory and populated WebContext.Current.User.Roles

which I was looking for.

+3


a source







All Articles