Silverlight RIA Services - how to do Windows Authentication?
- by Gustavo Cavalcanti
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:
Upon launch the application needs to recognize the currently logged-in user.
The application needs to have access to other properties of the user in AD, such as email, full name, and group membership.
Group membership is used to grand certain features in the application.
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.
This user is to be used in service calls
I have modified the following in the default Business Application template:
App.xaml: appsvc:WindowsAuthentication instead of the default FormsAuthentication
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.