Silverlight RIA Services - как сделать аутентификацию Windows?

Это явно называет текущий каталог.

5
задан Hossein Narimani Rad 27 April 2015 в 07:51
поделиться

3 ответа

In order to do this you will have to write your own Profile Provider and then modify the user class to include these profile properties which you can then access.

Have a look at page Section 13.3 of the RIA Services Overview document and let me know if you need any help.

We are just in the middle of implementing a RIA Services application and have written our own custom membership provide and profile provider so let me know if you need a hand.

4
ответ дан 13 December 2019 в 22:11
поделиться

Вот как я взломал его на AuthenticationService, предоставляемом BusinessApplicationTemplate.

 [EnableClientAccess]
    public class AuthenticationService : AuthenticationBase<User> {

    protected override User  GetAuthenticatedUser(System.Security.Principal.IPrincipal principal)
    {
        User user = base.GetAuthenticatedUser(principal);
        Configuration config = WebConfigurationManager.OpenWebConfiguration("~");
        SystemWebSectionGroup grp = (SystemWebSectionGroup)config.GetSectionGroup("system.web");
        AuthenticationSection auth = grp.Authentication;
        if (auth.Mode == AuthenticationMode.Forms)
        {
        }
        else if (auth.Mode == AuthenticationMode.Windows)
        {
            string[] a = user.Name.Split('\\');
            System.DirectoryServices.DirectoryEntry ADEntry = new System.DirectoryServices.DirectoryEntry("WinNT://" + a[0] + "/" + a[1]);
            string Name = ADEntry.Properties["FullName"].Value.ToString();
            user.Name = Name;
        }
        return user;
    }
}
3
ответ дан 13 December 2019 в 22:11
поделиться

Привет всем, в MSDN появилась новая статья, сейчас я работаю над ней.

http://msdn.microsoft.com/en-us/library/ee707353 (VS.91) .aspx

3
ответ дан 13 December 2019 в 22:11
поделиться
Другие вопросы по тегам:

Похожие вопросы: