Created
December 5, 2020 17:01
-
-
Save manoj-choudhari-git/aef2f93698111cfe13f613389c78a95e to your computer and use it in GitHub Desktop.
Entity framework data models for holding refresh tokens
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ApplicationDbContext : IdentityDbContext<ApplicationUser> | |
{ | |
public ApplicationDbContext(DbContextOptions options) : base(options) | |
{ | |
} | |
} | |
// Identity User table, which will hold reference to the refresh tokens. | |
public class ApplicationUser: IdentityUser | |
{ | |
public List<RefreshToken> RefreshTokens { get; set; } | |
} | |
// Table to hold the refresh tokens | |
public class RefreshToken | |
{ | |
[Key] | |
public int Id { get; set; } | |
public string Token { get; set; } | |
public string UserId { get; set; } | |
public DateTime ExpiryOn { get; set; } | |
public DateTime CreatedOn { get; set; } | |
public string CreatedByIp { get; set; } | |
public DateTime RevokedOn { get; set; } | |
public string RevokedByIp { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment