Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
334 views
in Technique[技术] by (71.8m points)

c# - How to fake Active Directory?

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 to an existing server with Active Directory (except through ten steps connecting to a VPN). I would rather not create a virtual machine to run Windows Server. Is there anything out there that might run in memory and intercept AD calls to return faked data? If it doesn't exist already, what would it take, theoretically, to pull this off?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...