I\'m new to ASP.NET identity and am still trying to get my head around how it all works. Unfortunately I\'ve found many of the tutorials I\'ve tried are for Identity 1.0, wherea
I think this has been updated recently to this in ApplicationUser
:
public async Task GenerateUserIdentityAsync(UserManager manager, string authenticationType)
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(this, authenticationType);
// Add custom user claims here
return userIdentity;
}
It is called like this from AccountController
-> GetExternalLogin
ClaimsIdentity oAuthIdentity = await user.GenerateUserIdentityAsync(UserManager,
OAuthDefaults.AuthenticationType);
ClaimsIdentity cookieIdentity = await user.GenerateUserIdentityAsync(UserManager,
CookieAuthenticationDefaults.AuthenticationType);