Asp.net mvc ASP MVC如何创建自定义表单sauthentication.SetAuthCookie?

Asp.net mvc ASP MVC如何创建自定义表单sauthentication.SetAuthCookie?,asp.net-mvc,authentication,forms-authentication,Asp.net Mvc,Authentication,Forms Authentication,当我像这样设置AuthCookie时 FormsAuthentication.SetAuthCookie(model.UserName, true); model.userName实际上是用户电子邮件,它是唯一标识每个用户的电子邮件,然后在我的视图中使用: Welcome <strong> @User.Identity.Name</strong>! 欢迎@User.Identity.Name! 它显示“欢迎”user@mail.com!,但是我想使用user.fir

当我像这样设置AuthCookie时

FormsAuthentication.SetAuthCookie(model.UserName, true);
model.userName实际上是用户电子邮件,它是唯一标识每个用户的电子邮件,然后在我的视图中使用:

Welcome <strong> @User.Identity.Name</strong>!
欢迎@User.Identity.Name
它显示“欢迎”user@mail.com!,但是我想使用user.firstname

因此,我的问题是,是否可以实现自定义User.Identity或自定义Forms.SetAuthCookie,使我能够在视图中使用类似的内容:

Welcome <strong> @User.Identity.FirstName</strong>!
欢迎@User.Identity.FirstName
您可以访问该类提供的一些信息。但是,名字或姓氏没有属性,这意味着您需要实现自定义成员资格用户/提供者。请参阅。

您可以访问该类提供的一些信息。但是,名字或姓氏没有属性,这意味着您需要im请创建自定义成员资格用户/提供商。请参阅