How to fake Active Directory?

前端 未结 4 1229
星月不相逢
星月不相逢 2020-12-16 01:48

I am developing an application in C# that needs to authenticate against Active Directory. I have Windows 7 and can\'t install Active Directory locally. I don\'t have access

相关标签:
4条回答
  • 2020-12-16 01:58

    You can also use this AD server hosted on Azure for testing and development purposes:

    https://documize.github.io/ad-ldap-test-server

    0 讨论(0)
  • 2020-12-16 02:00

    I think your best solution is to install virtual server for development. I would not recommend joining your workstation to a domain inside your workstation, but you can use remote debugger to debug applications inside virtual machine. Just make a network share on your guest and then configure your debug project to output the build into this directory. Then in Debug tab or project properties specify "Use remote machine" and you will be able to debug right there. You might need to create a local administrator account with the same name and password as your host to enable seemless authentication. In such configuration debugging in virtual guest system is not much different than debugging locally.

    If you only need such a thing for unit testing, or need to unbind from AD for unit testing, another answer about mocking would be logical approach.

    I guess that creating a full-blown fake implementation of AD is meaningless.

    0 讨论(0)
  • 2020-12-16 02:09

    You could use dependency injection and then mock out Active Directory calls in your unit tests.

    0 讨论(0)
  • 2020-12-16 02:09

    I found the ldap-test-server project on GitHub and started it successfully in a docker container. Then I was able to list the users via https://directory.apache.org/studio/

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