| | | 1 | | namespace ProjectTemplate.Infrastructure.Data.Entities; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Represents a persisted link between a local application user and an external authentication provider identity. |
| | | 5 | | /// </summary> |
| | | 6 | | public sealed class ExternalLoginAccount : DataEntity |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// Local application user ID to which this external login account is linked. |
| | | 10 | | /// </summary> |
| | 62 | 11 | | public Guid LocalUserId { get; set; } |
| | | 12 | | |
| | | 13 | | /// <summary> |
| | | 14 | | /// Provider name of the external authentication service (e.g., "Google", "Facebook", "Microsoft"). |
| | | 15 | | /// </summary> |
| | 384 | 16 | | public string ProviderName { get; set; } = string.Empty; |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// Normalized provider name used for lookup and uniqueness comparisons. |
| | | 20 | | /// </summary> |
| | 178 | 21 | | public string NormalizedProviderName { get; set; } = string.Empty; |
| | | 22 | | |
| | | 23 | | /// <summary> |
| | | 24 | | /// Provider-specific unique identifier for the user (e.g., the "sub" claim from an OpenID Connect token). |
| | | 25 | | /// </summary> |
| | 308 | 26 | | public string ProviderUserId { get; set; } = string.Empty; |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Display name or email associated with the external account, for informational purposes. This is not used for aut |
| | | 30 | | /// </summary> |
| | 236 | 31 | | public string? DisplayName { get; set; } |
| | | 32 | | |
| | | 33 | | /// <summary> |
| | | 34 | | /// Email address associated with the external account, if available. This is not used for authentication but can be |
| | | 35 | | /// </summary> |
| | 284 | 36 | | public string? Email { get; set; } |
| | | 37 | | |
| | | 38 | | /// <summary> |
| | | 39 | | /// Normalized email address used for lookup comparisons when email-based lookup is needed. |
| | | 40 | | /// </summary> |
| | 80 | 41 | | public string? NormalizedEmail { get; set; } |
| | | 42 | | |
| | | 43 | | /// <summary> |
| | | 44 | | /// Creation timestamp in UTC when this external login account was linked to the local user. This can be useful for |
| | | 45 | | /// </summary> |
| | 168 | 46 | | public DateTime CreatedOnUtc { get; set; } = PersistenceTimestamp.UtcNow(); |
| | | 47 | | |
| | | 48 | | /// <summary> |
| | | 49 | | /// Update timestamp in UTC when this external login account was last modified. This can be useful for auditing and |
| | | 50 | | /// </summary> |
| | 22 | 51 | | public DateTime? UpdatedOnUtc { get; set; } |
| | | 52 | | |
| | | 53 | | /// <summary> |
| | | 54 | | /// Last login timestamp in UTC when the user authenticated using this external login account. This can be useful fo |
| | | 55 | | /// </summary> |
| | 16 | 56 | | public DateTime? LastLoginOnUtc { get; set; } |
| | | 57 | | } |