实现IIdentity,什么是AuthenticationType?
我有一个实现 IIdentity 的自定义类(具有 UserID、UserName、UserEmail 等属性)。我通过自定义逻辑登录,该逻辑从 sql 读取。 IIdentity 的 AuthenticationType 应该返回什么?
I have a custom class (with properties like UserID, UserName, UserEmail, etc) implementing IIdentity. I login through custom logic, which reads from sql. What should IIdentity's AuthenticationType return?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能收集到的最好信息是,
AuthenticationType
是一个任意字符串,您可以在应用程序中使用它来确定用户使用的身份验证类型。例如,您的应用程序可能提供多种不同的身份验证机制,例如 Passport 和 Custom,其中 Custom 是您自己推出并决定将其称为“Custom”的内容。在应用程序的其他位置,您可能有需要了解用户如何进行身份验证的逻辑,在这种情况下,您根据自定义机制的名称(“自定义”)检查 AuthenticationType 值。
The best that I can gather is that
AuthenticationType
is an arbitrary string that you can use in your app to determine the type of authentication that was used by a user.For example, your app may offer a couple of different authentication mechanisms such as Passport and Custom, where Custom is something that you rolled yourself and decided to call it "Custom". Elsewhere in your app, you might have logic that needs to know how the user was authenticated, in which case you check the
AuthenticationType
value against the name of your custom mechanism - "Custom".