Skip to content

Instantly share code, notes, and snippets.

@manoj-choudhari-git
Created December 5, 2020 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manoj-choudhari-git/aef2f93698111cfe13f613389c78a95e to your computer and use it in GitHub Desktop.
Save manoj-choudhari-git/aef2f93698111cfe13f613389c78a95e to your computer and use it in GitHub Desktop.
Entity framework data models for holding refresh tokens
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