Mixed Forms and LDAP authentication with auto-registration with ASP.NET MVC

后端 未结 1 1140
难免孤独
难免孤独 2021-01-17 06:54

I need to use Form-Based authentication on an ASP.NET MVC web site with LDAP (Active Directory) backend like TeamCity for instance.

So i need to query LDAP first if

1条回答
  •  逝去的感伤
    2021-01-17 07:32

    I have a vaguely similar setup but i dont register the users locally for Forms auth. When using Windows Auth i can get the LDAP user info and then i query LDAP with that info (knowing the user's sAMAccountName and domain).

    I think you would want to configure your app for Forms auth and then have your login action determine if the credentials supplied validated first in forms then if not, over the LDAP with some nice conditional logic.

    You could authenticate over LDAP with this code example and then populate your local Forms Membership db with the relevant user info. Maybe even store the LDAP DN with the aspnet Membership user in the db for further LDAP calls.

    0 讨论(0)
提交回复
热议问题