Accessing Active Directory in ASP.NET?

后端 未结 5 585
[愿得一人]
[愿得一人] 2021-02-04 18:36

I use a console application to write some test code:

    /// 
    /// Returns AD information for a specified userID.
    /// 
    /         


        
5条回答
  •  南旧
    南旧 (楼主)
    2021-02-04 19:08

    Alternatively you could specify identity impersonate=true in the web.config and the request to Active directory will be sent as the calling user instead of Machine\ASPNET

    Edit: If you are getting the authentication error see PIPTHEGEEK's post you will have to trust your web server for delegation, however be careful with trusting for delegation (since it opens another can of worms for security types). You have to allow the web server to pass the credentials of the current user to AD.

    If possible, go to AD properties for the computer, select the delegation tab, and select "Trust this computer for delegation to any service (Kerberos Only)

    See if that works. If it does, you can further fine grain the permissions by using the third option which states

    "Trust this computer for delegation to specified services only"

    Then select "Use Kerberos Only"

    and in the "services to which this account can present delegated credentials", add the relevant service information.

提交回复
热议问题