Silverlight RIA Services - how to do Windows Authentication?

Posted by Gustavo Cavalcanti on Stack Overflow See other posts from Stack Overflow or by Gustavo Cavalcanti
Published on 2009-09-19T18:06:17Z Indexed on 2010/04/22 21:43 UTC
Read the original article Hit count: 350

I am building my first Silverlight 3 + RI Services application and need some help.
It will be deployed in an controlled corporate intranet, 100% windows clients. I have started from the Silverlight Business Application template.
These are my requirements:

  1. Upon launch the application needs to recognize the currently logged-in user.
  2. The application needs to have access to other properties of the user in AD, such as email, full name, and group membership.
  3. Group membership is used to grand certain features in the application.
  4. A "login as a different user" link is to be always available - Some machines are available throughout the enterprise, logged-in as a certain generic user (verified by the absence of certain membership groups). In this case one can enter credentials and log in (impersonate) to the application as a user different from the one already logged-into the machine.
  5. This user is to be used in service calls


I have modified the following in the default Business Application template:

  1. App.xaml: appsvc:WindowsAuthentication instead of the default FormsAuthentication
  2. Web.config: authentication mode="Windows"

With these modifications I resolve requirement #1 (get the currently logged-in user). But when I examine RiaContext.Current.User, I don't have access to other properties from AD, such as group memberships. How can I achieve my other requirements?

Thanks for your help.

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about ria-services