A set of libraries to easily integrate and extend authentication in ASP.NET Core projects, using ASP.NET Core Identity.
$ dotnet add package Identity.Module.APIA set of libraries to easily integrate and extend authentication in ASP.NET Core projects, using ASP.NET Core Identity.
[!IMPORTANT] This library is still under development of new implementations and in the process of creating the related documentation.
appsettings.json to suit your application's needs.The library is available on NuGet, just search for Identity.Module.API in the Package Manager GUI or run the following command in the .NET CLI:
dotnet add package Identity.Module.APIThe configuration can be completely managed by adding this section to the appsettings.json file:
[!WARNING] The library is still under development, so the configuration may change in future updates.
{
"ConnectionStrings": {
"DatabaseType": "sqlserver",
"SQLServer": "Data Source=[HOSTNAME];Initial Catalog=[DATABASE];User ID=[USERNAME];Password=[PASSWORD];Encrypt=False"
},
"JwtOptions": {
"SchemaName": "Bearer",
"Issuer": "[ISSUER]",
"Audience": "[AUDIENCE]",
"SecurityKey": "[SECURITY-KEY-512-CHAR]",
"ClockSkew": "00:05:00",
"AccessTokenExpirationMinutes": 60,
"RefreshTokenExpirationMinutes": 60,
"RequireUniqueEmail": true,
"RequireDigit": true,
"RequiredLength": 8,
"RequireUppercase": true,
"RequireLowercase": true,
"RequireNonAlphanumeric": true,
"RequiredUniqueChars": 4,
"RequireConfirmedEmail": true,
"MaxFailedAccessAttempts": 3,
"AllowedForNewUsers": true,
"DefaultLockoutTimeSpan": "00:05:00"
},
"SmtpOptions": {
"Host": "smtp.example.org",
"Port": 25,
"Security": "StartTls",
"Username": "Username del server SMTP",
"Password": "Password del server SMTP",
"Sender": "MyApplication <noreply@example.org>",
"SaveEmailSent": true
},
"ApplicationOptions": {
"MigrationsAssembly": "MinimalApi.Identity.Migrations",
"ErrorResponseFormat": "List"
},
"FeatureFlagsOptions": {
"EnabledFeatureLicense": true,
"EnabledFeatureModule": true
},
"HostedServiceOptions": {
"IntervalAuthPolicyUpdaterMinutes": 5
},
"UsersOptions": {
"AssignAdminRoleOnRegistration": "admin@example.org",
"PasswordExpirationDays": 90
},
"ValidationOptions": {
"MinLength": 3,
"MaxLength": 50,
"MinLengthDescription": 5,
"MaxLengthDescription": 100
}
}[!NOTE] For migrations you can use a specific project to add to your solution, then configuring the assembly in ApplicationOptions:MigrationsAssembly, otherwise leave it blank and the assembly containing the Program.cs class will be used.
See the documentation for managing the database
[!WARNING] The library is still under development, so the Program.cs configuration may change in future updates.
A practical example of Program.cs configuration is available here
This library currently supports the following authentication types:
See the documentation for a list of all available endpoints.
See the documentation for a list of all available packages.
This project is licensed under the MIT License - see the LICENSE file for details.
Don't forget that if you find this project useful, put a ⭐ on GitHub to show your support and help others discover it.
The project is constantly evolving. Contributions are always welcome. Feel free to report issues and submit pull requests to the repository, following the steps below:
If you have any questions or need help, you can add a new thread here.