DMIdentity.Jwt 1.0.0

.NET Core 2.2
dotnet add package DMIdentity.Jwt --version 1.0.0
NuGet\Install-Package DMIdentity.Jwt -Version 1.0.0
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="DMIdentity.Jwt" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DMIdentity.Jwt --version 1.0.0
#r "nuget: DMIdentity.Jwt, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install DMIdentity.Jwt as a Cake Addin
#addin nuget:?package=DMIdentity.Jwt&version=1.0.0

// Install DMIdentity.Jwt as a Cake Tool
#tool nuget:?package=DMIdentity.Jwt&version=1.0.0

DM Identity Jwt

Resposta ao logar

public class JwtResponse
{
    public bool Authenticated { get; set; }
    public string Created { get; set; }
    public string Expiration { get; set; }
    public string AccessToken { get; set; }
    public string Message { get; set; }
    public string Email { get; set; }
}

##Parametros para Login e Registar

public class UserLogin
{
    [EmailAddress(ErrorMessage = "E-mail inválido.")]
    [MaxLength(60, ErrorMessage = "O email deve conter no máximo 60 caracteres.")]
    [Required(ErrorMessage = "Email deve ser informado.")]
    public string Email { get; set; }

    [MaxLength(20, ErrorMessage = "A senha ultrapassou o tamanho limite.")]
    [MinLength(6, ErrorMessage = "Senha deve conter no mínimo 6 caracteres.")]
    [Required(ErrorMessage = "Senha deve ser informada.")]
    public string Senha { get; set; }
}

public class User
{        
    [EmailAddress(ErrorMessage = "Email invalido")]
    [MaxLength(60, ErrorMessage = "O email deve conter no máximo 60 caracteres")]
    [Required(ErrorMessage = "O email deve ser informado.")]
    public string Email { get; set; }

    [MaxLength(20, ErrorMessage = "A senha ultrapassou o tamanho limite")]
    [MinLength(6, ErrorMessage = "Senha deve conter no mínimo 6 caracteres")]
    [Required(ErrorMessage = "A senha deve ser informada.")]
    public string Senha { get; set; }
    
}

Configuração no projeto principal

    public void ConfigureServices(IServiceCollection services)
    {
        services.ConfigToken(Configuration, builder =>
            builder.UseSqlServer(Configuration.GetConnectionString("SuaStringConexao"), b => b.MigrationsAssembly("NomeSeuProjetoPrincipal")));            

        services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
    }
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 375 9/24/2019

First Version