给定一个 3 层架构:
- 域逻辑层
- 数据访问层
- 用户界面层(ASP.NET MVC Web 应用)
放置与构建自定义用户身份、添加自定义声明并将其签名到 Web 应用程序相关的逻辑的正确位置是什么?
例如,这样的逻辑:
if (something)
customClaim = new Claim("MyClaimType1", "SomeClaimValue");
else
customClaim = new Claim("MyClaimType2", "AnotherClaimValue");
customClaimsIdentity.AddClaim(customClaim);
HttpContext.Current.GetOwinContext().Authentication.SignIn(customClaimsIdentity);
我想说的是 UI 层,但自定义逻辑(即自定义用户)不是领域的东西吗?这里有点迷茫...