Synetec.UserManager
2.3.1
dotnet add package Synetec.UserManager --version 2.3.1
NuGet\Install-Package Synetec.UserManager -Version 2.3.1
<PackageReference Include="Synetec.UserManager" Version="2.3.1" />
<PackageVersion Include="Synetec.UserManager" Version="2.3.1" />
<PackageReference Include="Synetec.UserManager" />
paket add Synetec.UserManager --version 2.3.1
#r "nuget: Synetec.UserManager, 2.3.1"
#:package Synetec.UserManager@2.3.1
#addin nuget:?package=Synetec.UserManager&version=2.3.1
#tool nuget:?package=Synetec.UserManager&version=2.3.1
Synetec.UserManager
This library enables user management within an application using Microsoft B2C Authentication.
It supports key workflows such as:
- Inviting a user to the application
- Validating a user token, returning the B2C workflow to use
- Roles for the user, including an authorization filter
Configuration
{
"UserManager": {
"AzureAdB2C": {
"Instance": "https://<B2Cdomain>.b2clogin.com/tfp/",
"Domain": "<B2Cdomain>.onmicrosoft.com",
"ClientId": "00000000-0000-0000-0000-000000000000",
"TenantId": "00000000-0000-0000-0000-000000000000",
"SignUpSignInPolicyId": "B2C_1_<policy_name>",
"ResetPasswordPolicyId": "B2C_1_<policy_name>",
"EditProfilePolicyId": "B2C_1_<policy_name>"
},
"Database": {
"ConnectionString": "Server=(localdb)\\mssqllocaldb;Database=Synetec.UserManager;Trusted_Connection=True;MultipleActiveResultSets=true"
},
"Email":{
"DefaultFromEmail": "sender@test.com",
"ApiKey": "SendGrid API Key",
"DefaultToEmail": "recipient@test.com", // When set all email is sent to this address
"SignUpEmail": {
"Template": "<relative path to template>",
"Subject": "Subject line for email",
"FromEmail": "differentsender@test.com",
"Url":"<URL for registration page>"
},
"ChangedEmailTemplate": {
"Template": "<relative path to template>",
"Subject": "Subject line for email",
"FromEmail": "differentsender@test.com",
"Url":"<URL for registration page>"
}
},
"SignUpJwt" : {
"Issuer": "https://usermanager",
"Audience": "https://usermanager",
"Secret" : "<Secret key - must be at least 256 bytes>"
},
"DefaultPageSize": 25
}
}
Authentication registration
For .Net8 and greater, the JWT authentication will automatically be registered when the DI container is initialized.
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddUserManager(builder.Configuration);
Database
Tables required to support this, will automatically be created in a Schema called UserManager.
Migrations should be run by the Azure Pipeline or your code.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Asp.Versioning.Http (>= 8.1.0)
- Asp.Versioning.Mvc.ApiExplorer (>= 8.1.0)
- FluentResults (>= 4.0.0)
- MediatR (>= 13.0.0)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.10)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.10)
- Microsoft.Identity.Web (>= 3.14.1)
- Synetec.Core (>= 1.1.0)
- Synetec.Notifications (>= 4.2.0)
- System.Net.Http (>= 4.3.4)
- System.Text.RegularExpressions (>= 4.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Extends the application methods to retrieve a user by their email address for the system.