断开连接的 Active Directory 的 ASP.NET MVC3 开发实践

发布于 2024-11-24 19:59:33 字数 187 浏览 1 评论 0原文

我正在启动一个新的 MVC 3 应用程序,同时我正在过渡到一个更加断开连接的开发环境,在该环境中我只会偶尔连接到公司网络进行部署。

我通常使用 [Authorize(Roles = @"xxx,yyy")] 属性来处理基本的组身份验证,但是当然,当我在开发过程中断开连接时,这将不起作用。

有人对这种情况有什么建议或最佳实践吗?

I'm starting a new MVC 3 application at the same time I'm transitioning to a more disconnected development environment where I will only occasionally be connected to the corporate network to do deployments.

I have normally used the [Authorize(Roles = @"xxx,yyy")] attributes to handle basic group authentication, but of course when I'm disconnected doing development, this will not work.

Does anyone have any suggestions or best practices for this kind of situation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忘年祭陌 2024-12-01 19:59:33

每当您需要针对您可能无法完全(或任何)访问的资源进行开发时,您都应该考虑使用模拟框架。 MoqRhino Mocks 只是用于此目的的两个更流行的框架。

这个想法是创建一个您的代码将使用的接口,以便您可以根据您正在使用的环境交换实际的 AD 提供程序或模拟框架。

Any time you need to do development against a resource that you may not have full (or any) access to, you should consider a mocking framework. Moq and Rhino Mocks are just two of the more popular frameworks for this purpose.

The idea is to create an interface that your code will use so that you can swap in the actual AD provider or the mocking framework depending upon which environment you're working with.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文