forked from maxiomtech/MongoDB.AspNet.Identity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIdentityUser.cs
More file actions
124 lines (103 loc) · 4.18 KB
/
IdentityUser.cs
File metadata and controls
124 lines (103 loc) · 4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace MongoDB.AspNet.Identity
{
/// <summary>
/// Represents a user in the identity system.
/// </summary>
public class IdentityUser
{
/// <summary>
/// Gets or sets the unique identifier for this user.
/// </summary>
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public virtual string Id { get; set; } = null!;
/// <summary>
/// Gets or sets the user name for this user.
/// </summary>
public virtual string? UserName { get; set; }
/// <summary>
/// Gets or sets the normalized user name for this user.
/// </summary>
public virtual string? NormalizedUserName { get; set; }
/// <summary>
/// Gets or sets the email address for this user.
/// </summary>
public virtual string? Email { get; set; }
/// <summary>
/// Gets or sets the normalized email address for this user.
/// </summary>
public virtual string? NormalizedEmail { get; set; }
/// <summary>
/// Gets or sets a flag indicating if the email address has been confirmed.
/// </summary>
public virtual bool EmailConfirmed { get; set; }
/// <summary>
/// Gets or sets the password hash for this user.
/// </summary>
public virtual string? PasswordHash { get; set; }
/// <summary>
/// Gets or sets a random value that should change when a user's credentials change.
/// </summary>
public virtual string? SecurityStamp { get; set; }
/// <summary>
/// Gets or sets a random value that should change when a user is persisted to the store.
/// </summary>
public virtual string? ConcurrencyStamp { get; set; } = Guid.NewGuid().ToString();
/// <summary>
/// Gets or sets the phone number for this user.
/// </summary>
public virtual string? PhoneNumber { get; set; }
/// <summary>
/// Gets or sets a flag indicating if the phone number has been confirmed.
/// </summary>
public virtual bool PhoneNumberConfirmed { get; set; }
/// <summary>
/// Gets or sets a flag indicating if two factor authentication is enabled for this user.
/// </summary>
public virtual bool TwoFactorEnabled { get; set; }
/// <summary>
/// Gets or sets the date and time when any user lockout ends.
/// </summary>
public virtual DateTimeOffset? LockoutEnd { get; set; }
/// <summary>
/// Gets or sets a flag indicating if lockout is enabled for this user.
/// </summary>
public virtual bool LockoutEnabled { get; set; }
/// <summary>
/// Gets or sets the number of failed login attempts for this user.
/// </summary>
public virtual int AccessFailedCount { get; set; }
/// <summary>
/// Gets the roles for this user.
/// </summary>
public virtual List<string> Roles { get; private set; } = new List<string>();
/// <summary>
/// Gets the claims for this user.
/// </summary>
public virtual List<IdentityUserClaim> Claims { get; private set; } = new List<IdentityUserClaim>();
/// <summary>
/// Gets the logins for this user.
/// </summary>
public virtual List<IdentityUserLogin> Logins { get; private set; } = new List<IdentityUserLogin>();
/// <summary>
/// Gets the authentication tokens for this user.
/// </summary>
public virtual List<IdentityUserToken> Tokens { get; private set; } = new List<IdentityUserToken>();
/// <summary>
/// Initializes a new instance of the <see cref="IdentityUser"/> class.
/// </summary>
public IdentityUser()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="IdentityUser"/> class with the specified user name.
/// </summary>
/// <param name="userName">The user name.</param>
public IdentityUser(string userName) : this()
{
UserName = userName;
}
}
}