我使用asp.net的身份为我的安全框架,我知道regenerateIdentity
在我的app.UseCookieAuthentication
。
我正在向用户添加一些声明,例如,全名,可能会通过个人资料页面更新的电子邮件,在更新用户个人资料时如何更新当前的用户声明?
这是我使用的方法,使用以下方法与该用户再次注销并登录
private async Task SignInAsync(User user, bool isPersistent)
{
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie);
var identity = await user.GenerateUserIdentityAsync(UserManager);
AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity);
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句