Search code examples
wcf-ria-services

Detecting Windows ID of logged-in user in RIA


What is the best way to detect the current user Windows ID (on a corporate LAN on a Windows machine) in RIA? I assume I should use WindowsAuth for this


Solution

  • In your web.config file, set the authentication mode to "Windows". Also, in your client (assuming you're using the Business Application Template), you'll need to set webContext.Authentication to a new instance of WindowsAuthentication in App.xaml.cs.