Мне не удается заставить Windows Authentication работать в бизнес-приложении Silverlight.
Я внес необходимые изменения, см. Ниже
Изменен для аутентификации Windows в App.xaml
public App()
{
InitializeComponent();
// Create a WebContext and add it to the ApplicationLifetimeObjects
// collection. This will then be available as WebContext.Current.
WebContext webContext = new WebContext();
//webContext.Authentication = new FormsAuthentication();
webContext.Authentication = new WindowsAuthentication();
this.ApplicationLifetimeObjects.Add(webContext);
}
Изменена аутентификация Windows в web.config
<authentication mode="Windows"/>
<roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider"/>
Я поставил точку останова на событие Application_UserLoaded, но ничего не происходит: -
private void Application_UserLoaded(LoadUserOperation operation)
{
foreach (var r in WebContext.Current.User.Roles)
{
//do something
}
}
Может кто-нибудь подсказать, что происходит не так. Я не внес никаких других изменений в проект.