.net - 实现IIdentity,什么是AuthenticationType?

标签 .net authentication iidentity

我有一个实现 IIdentity 的自定义类(具有 UserID、UserName、UserEmail 等属性)。我通过自定义逻辑登录,该逻辑从 sql 读取。 IIdentity 的 AuthenticationType 应该返回什么?

最佳答案

我能收集到的最好信息是,AuthenticationType 是一个任意字符串,您可以在应用程序中使用它来确定用户使用的身份验证类型。

例如,您的应用可能会提供多种不同的身份验证机制,例如 Passport 和 Custom,其中 Custom 是您自己推出并决定将其称为“Custom”的内容。在应用的其他地方,您可能有需要了解用户如何进行身份验证的逻辑,在这种情况下,您根据自定义机制的名称(“自定义”)检查 AuthenticationType 值。

关于.net - 实现IIdentity,什么是AuthenticationType?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5868883/

相关文章:

c# - SerialPort 编码 - 如何获得 8 位 ASCII?

c# - 如何从 Apache NMS ActiveMQ 消息中获取底层流句柄

.net - AppDomain.CreateInstance 不遵守规则

security - 您可以在我的身份验证协议(protocol)中发现漏洞吗?

c# - Unity 等价于 Ninject 的 Bind.ToMethod of IPrincipal,IIdentity

.net - 在 Azure 媒体服务上发布视频

ruby-on-rails-3 - 如何使用 rspec 和 factory girl 设置我的身份验证数据?

delphi - DocuSign API - 如何在用户认证后获得回调响应?

asp.net - User.Identity.Name 和 User.Identity.IsAuthenticated 是什么集合?

asp.net - HttpContext.Current.User.Identity.Name 总是 string.Empty