cost 223 ms
自定义IAuthenticationFilter in ASP.NET Core 6 Web API 基于Active Directory - Custom IAuthenticationFilter in ASP.NET Core 6 Web API based on Active Directory

我需要根据本地 Active Directory 中的一些信息实施自定义授权。 在做了一些研究之后,我认为最好的方法是编写一个自定义身份验证过滤器并将该信息从 AD 添加到声明列表中。 因此,在用户通过 IIS 使用 Windows 身份验证进行身份验证后,我打算阅读一些信息并将其放入声明列表中: ...

ASP.NET Core 丰富的 IIdentity 与自定义配置文件 - ASP.NET Core enrich IIdentity with custom profile

我正在使用 Azure AD 来授权和验证用户。 所有用户在数据库中都有一个配置文件。 我想在登录时始终将 Azure 用户与我的数据库用户“合并”。 这是我用来在 web api 中设置身份验证的代码。 有人可以指出我正确的方向吗? 现在我在我所有的控制器中加载用户,一点也不漂亮。 ...

ASP.NET Core Identity - 如何在初始登录后添加新声明 - ASP.NET Core Identity - How to add new claims after initial login

我正在尝试根据从数据库查询的某些数据在初始登录后向身份添加新声明。 我添加的新声明不会持续用于后续请求。 这就是我在 ASP.NET MVC 中设置/添加声明的方式 ASP.NET Core 2.0 中是否有类似的方法来保留新添加的声明。 感谢您对此的任何想法。 ...

为什么带有域上下文的FindByIdentity忽略参数中的本地计算机名称? - Why is FindByIdentity with Domain Context ignoring local machine name in argument?

所以我有这个字符串: 我的计算机主机名是“ testvm”,我使用具有该名称的域上下文来调用FindByIdentity。 问题是FindByIdentity正在返回域管理员帐户(我知道,因为它具有该域帐户的非空UPN,本地帐户不能具有UPN)。 那么为什么忽略字符串的主机名部分呢? ...

ASP.NET MVC-具有Windows身份验证的自定义IIdentity或IPrincipal - ASP.NET MVC - Custom IIdentity or IPrincipal with Windows Authentication

我正在使用Windows身份验证进行登录的Intranet站点。 但是,我想将IPrincipal扩展为具有其他属性。 例如,我想使用活动代替角色来隐藏某些链接等,以@User.FirstName或User.AuthorizedActivity("Admin/Permissions/Edit ...

IIidentity IPrincipal中的购物车 - Shopping Cart in IIdentity IPrincipal

我正在为客户开发订单管理系统。 在这个系统中,我决定使用IPrincipal代替IIdentity。 我已经思考了很长时间,应该在哪里存储客户的购物车数据。 最终我决定将其存储在Cookie中。 我的第一个问题是:应该在哪里存储客户购物车数据? 在数据库中还是在cookie中? ...

如何使用C#在Window OS中的系统NT Authority\System下创建新用户 - How to Create New User under NT Authority\System the System in Window OS using C#

现在我的服务在 NT Local 系统下运行。 我想创建 NTUser 类型来运行该服务。 我不想创建本地系统帐户。 在服务中,当您查看在NT Service__下运行的某些帐户时。 我还希望创建自定义 NT Service\CustomName 用户来运行该服务。 ...

无法将类型“ CustomPrincipal”转换为“ System.Security.Principal.IPrincipal” - Cannot convert type 'CustomPrincipal' to 'System.Security.Principal.IPrincipal'

我已按照本指南向IPrincipal添加自定义属性。 这是最后一行出错。 无法将类型'SocialMedia.Models.CustomPrincipal'隐式转换为'System.Security.Principal.IPrincipal'。 存在显式转换(您是否缺少演员表 ...

自定义ASP.Net原理-无法将类型为“ System.Security.Principal.GenericPrincipal”的对象转换为“ Business.ICustomPrincipal” - Custom ASP.Net Principle - Unable to cast object of type 'System.Security.Principal.GenericPrincipal' to type 'Business.ICustomPrincipal'

我已经为ASP.Net身份实现了自定义原理,但是当我尝试从HttpContext.Current.User获取自定义原理时,收到以下异常: 无法将类型为“ System.Security.Principal.GenericPrincipal”的对象转换为类型为“ VenuePortal ...

如何在自定义JsonConverter中获取当前的IPrincipal? - How to get the current IPrincipal in custom JsonConverter?

在我的ASP.NET Web API应用程序中,我正在构建一个自定义JsonConverter以使用登录用户的偏移量将Json对象中的任何DateTime字符串转换为DateTimeOffset 。 我已在本文中阅读到,在序列化过程中将重置IPrincipal 。 本文提供了一个解决 ...

使用AspNet.Security.OpenIdConnect.Server(ASP.NET vNext)实现自定义主体 - Materializing Custom Principal With AspNet.Security.OpenIdConnect.Server (ASP.NET vNext)

我使用Visual Studio 2015年企业和ASP.NET vNext Beta8构建中详细描述了这两个问题,消耗JWT令牌端点这里 。 我正处于项目的阶段,我希望允许JWT承载身份验证按照上述文章中的说明进行,但是一旦对令牌进行身份验证,我想: 成功进行JWT身份验证后, ...

当你想在 Asp.net MVC 中创建自定义主体时,为什么要创建自定义主体接口? - Why to create a custom principal interface when you want to create a Custom Principal in Asp.net MVC?

最近我搜索了如何创建自定义主体,我得到了答案,但有一件事我不明白,我在堆栈溢出时找到了这个解决方案 但我不明白的是为什么开发人员创建了 ICustomPrincipal 接口并强制 CustomPrincipal 继承它为什么 CustomPrincipal 类不直接从 IPrincipal 接 ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM