ritterim / stuntman

Library for impersonating users during development leveraging ASP.NET Identity.
https://rimdev.io/stuntman/
MIT License
294 stars 35 forks source link

Does it work with Windows / Active Directory authentication? #114

Closed ignatandrei closed 8 years ago

ignatandrei commented 8 years ago

Does it work with Windows / Active Directory authentication?

khalidabuhakmeh commented 8 years ago

Hello @ignatandrei,

In short, _yes_.

All authentication mechanisms in ASP.NET utilize Principals, including Active Directory. The source of these principals is not as important as the final representation in your code. Stuntman bypasses the source and allows you to tweak the final representation of your user.

// doesn't matter if user came from
//   Active Directory,
//   Forms,
//   OR STUNTMAN 
HttpContext.User

Note: You will have to turn off Windows auth locally during development, but that is what we currently do with our Identity Server auth mechanism locally.


When you deploy to production, just disable Stuntman and turn on Windows Auth utilizing config transforms.

I hope that answers your question, but I am glad to answer any follow up ones too :)