Advertisement
AuriR

August 2015 - ElevenNoteApplicationUser.cs innards

Sep 1st, 2015
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
  2. public class ElevenNoteApplicationUser : IdentityUser
  3. {
  4. /// <summary>
  5. /// This version of the method GenerateUserIdentityAsync is used with the
  6. /// ASP.NET MVC website data context requests because the authentication type is usually Cookie-based.
  7. /// </summary>
  8. /// <param name="manager"></param>
  9. /// <returns></returns>
  10. public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ElevenNoteApplicationUser> manager)
  11. {
  12. // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
  13. var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
  14.  
  15. // Add custom user claims here
  16. return userIdentity;
  17. }
  18.  
  19. /// <summary>
  20. /// This version of the method GenerateUserIdentityAsync is used with the
  21. /// WebAPI data context requests because the authentication type could vary.
  22. /// </summary>
  23. /// <param name="manager"></param>
  24. /// <param name="authenticationType"></param>
  25. /// <returns></returns>
  26. public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ElevenNoteApplicationUser> manager, string authenticationType)
  27. {
  28. // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
  29. var userIdentity = await manager.CreateIdentityAsync(this, authenticationType);
  30.  
  31. // Add custom user claims here
  32. return userIdentity;
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement