EasyRefreshToken 5.0.8

There is a newer version of this package available.
See the version list below for details.
dotnet add package EasyRefreshToken --version 5.0.8
NuGet\Install-Package EasyRefreshToken -Version 5.0.8
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EasyRefreshToken" Version="5.0.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasyRefreshToken --version 5.0.8
#r "nuget: EasyRefreshToken, 5.0.8"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EasyRefreshToken as a Cake Addin
#addin nuget:?package=EasyRefreshToken&version=5.0.8

// Install EasyRefreshToken as a Cake Tool
#tool nuget:?package=EasyRefreshToken&version=5.0.8

EasyRefreshToken 6.0.8

What's new??

  • Max number of active devices per user type (TPT).
  • Max number of active devices per user property (this option uses Reflection, so may be slow!)

Documentation

  • Create your own class "MyRefreshToken" and add to it the properties you want and make it inherit from RefreshToken<TUser, TKey>

  • If you do not want to add new features, you can skip the previous step.

  • In AppDbContext Class: public DbSet<RefreshToken<TUser, TKey>> RefreshTokens { get; set; } or public DbSet<MyRefreshToken> RefreshTokens { get; set; }

  • In Program Class:

    builder.Services.AddRefreshToken<AppDbContext, RefreshToken<TUser, TKey>, TUser, TKey>(); or builder.Services.AddRefreshToken<AppDbContext, MyRefreshToken, TUser, TKey>();

  • Don't forget: Add-Migration Update-Database

  • Now you can use ITokenService<TKey> that contains:

    • OnLogin
    • OnLogout
    • OnAccessTokenExpired
    • OnChangePassword
    • Clear
    • ClearExpired
  • And you can control with many options:

    • MaxNumberOfActiveDevices
    • TokenExpiredDays
    • PreventingLoginWhenAccessToMaxNumberOfActiveDevices
    • TokenGenerationMethod
    • OnChangePasswordBehavior
  • for MaxNumberOfActiveDevices use CustomMaxNumberOfActiveDevices.Config().

  • Note: when change on options, I highly recommend cleaning the table by Clear

  • Enjoy ...

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on EasyRefreshToken:

Package Downloads
EasyRefreshToken.InMemory

Package for manage refresh token

EasyRefreshToken.EFCore

Package for manage refresh token

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.2.2 149 1/5/2024
7.2.2 102 1/5/2024
7.2.1 188 6/27/2023
7.2.0 181 6/9/2023
7.1.2 171 5/21/2023
7.1.1 170 5/5/2023
7.1.0 246 2/24/2023
7.0.10 336 11/26/2022
6.2.2 117 1/5/2024
6.2.1 180 6/27/2023
6.2.0 133 6/9/2023
6.1.2 133 5/21/2023
6.1.1 156 5/5/2023
6.1.0 255 2/24/2023
6.0.10 339 11/4/2022
6.0.9 379 8/31/2022
6.0.8 436 7/8/2022
6.0.7 426 7/3/2022
6.0.6 417 6/20/2022
6.0.5 403 6/20/2022
5.2.2 122 1/5/2024
5.2.1 166 6/27/2023
5.2.0 132 6/9/2023
5.1.2 139 5/21/2023
5.1.1 140 5/5/2023
5.1.0 243 2/24/2023
5.0.10 356 11/5/2022
5.0.9 433 8/31/2022
5.0.8 493 7/8/2022
5.0.7 427 7/3/2022
5.0.6 395 6/20/2022
5.0.5 465 6/20/2022