DDD 中的授权和身份验证 (c#)
我将处理有关身份验证和授权的架构。
我想知道是否有人愿意分享其在 DDD 领域获得的经验。
同样的问题......都是横切问题吗?我们需要 Ioc 来管理它们吗?那么WIF呢?
感谢分享!
I am going to deal with architecture with regard to authentication and authorization.
I'd like to know if someone wants to share its experience gained in the field of DDD.
Same questions... are both crosscutting issues? we need Ioc to manage them? what about WIF?
Thanks to share!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据我的经验,身份验证和授权在控制器级别效果最好(如果您正在开发 MVC Web 应用程序)。您不希望这些东西污染您的域对象/服务/命令处理程序/任何东西,更不用说对这些东西的测试了。
简而言之,我认为身份验证和授权是一个查询类型的问题,因此请执行以下操作(示例是 C#/ASP.NET MVC):
In my experience, authentication and authorization work best at the controller level (if you're doing an MVC web app). You don't want these things polluting your domain objects/services/command handlers/whatever, much less the tests for these things.
In short, I consider authentication and authorization a querying-type issue so do stuff like this (example is C#/ASP.NET MVC):