using System; using System.Collections.Generic; using System.Linq; #if NET45 using System.Security.Claims; #else using System.Security.ClaimsK; #endif using System.Threading.Tasks; using Microsoft.AspNet.Identity; namespace Microsoft.AspNet.Identity.InMemory { public class InMemoryUser : IUser { private readonly IList _claims; private readonly IList _logins; private readonly IList _roles; public InMemoryUser(string name) { Id = Guid.NewGuid().ToString(); _logins = new List(); _claims = new List(); _roles = new List(); UserName = name; } /// /// Email /// public virtual string Email { get; set; } /// /// True if the email is confirmed, default is false /// public virtual bool EmailConfirmed { get; set; } /// /// The salted/hashed form of the user password /// public virtual string PasswordHash { get; set; } /// /// A random value that should change whenever a users credentials have changed (password changed, login removed) /// public virtual string SecurityStamp { get; set; } /// /// PhoneNumber for the user /// public virtual string PhoneNumber { get; set; } /// /// True if the phone number is confirmed, default is false /// public virtual bool PhoneNumberConfirmed { get; set; } /// /// Is two factor enabled for the user /// public virtual bool TwoFactorEnabled { get; set; } /// /// DateTime in UTC when lockout ends, any time in the past is considered not locked out. /// public virtual DateTimeOffset LockoutEnd { get; set; } /// /// Is lockout enabled for this user /// public virtual bool LockoutEnabled { get; set; } /// /// Used to record failures for the purposes of lockout /// public virtual int AccessFailedCount { get; set; } public IList Logins { get { return _logins; } } public IList Claims { get { return _claims; } } public IList Roles { get { return _roles; } } public virtual string Id { get; set; } public virtual string UserName { get; set; } } }