Synetec.UserManager
3.1.0
dotnet add package Synetec.UserManager --version 3.1.0
NuGet\Install-Package Synetec.UserManager -Version 3.1.0
<PackageReference Include="Synetec.UserManager" Version="3.1.0" />
<PackageVersion Include="Synetec.UserManager" Version="3.1.0" />
<PackageReference Include="Synetec.UserManager" />
paket add Synetec.UserManager --version 3.1.0
#r "nuget: Synetec.UserManager, 3.1.0"
#:package Synetec.UserManager@3.1.0
#addin nuget:?package=Synetec.UserManager&version=3.1.0
#tool nuget:?package=Synetec.UserManager&version=3.1.0
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,
"CreateMissingTokenOnResendInvite": false
}
}
Resending invitations for migrated users
UserManager:CreateMissingTokenOnResendInvite defaults to false. With the flag omitted or false,
resending an invitation requires an existing active, non-deleted token; an expired token can still be renewed.
Set the flag to true to allow resend to create a new token when none is available and the user's
ObjectId is null (signup is incomplete). This supports migrated users who have no token history.
The new token has the usual seven-day validity and triggers the existing invitation email workflow,
using the application's configured signup email settings. Inactive or deleted tokens are not reused.
Users whose ObjectId is non-null cannot receive a newly created token through this fallback.
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 is compatible. 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. |
-
net10.0
- Asp.Versioning.Http (>= 8.1.0)
- Asp.Versioning.Mvc.ApiExplorer (>= 8.1.0)
- FluentResults (>= 4.0.0)
- MediatR (>= 14.2.0)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.10)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Identity.Web (>= 4.15.0)
- Synetec.Core (>= 3.0.0)
- Synetec.Data.SqlClient.ManagedIdentity (>= 1.0.0)
- Synetec.Notifications (>= 5.0.0)
-
net8.0
- Asp.Versioning.Http (>= 8.1.0)
- Asp.Versioning.Mvc.ApiExplorer (>= 8.1.0)
- FluentResults (>= 4.0.0)
- MediatR (>= 14.2.0)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.10)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Identity.Web (>= 4.15.0)
- Synetec.Core (>= 3.0.0)
- Synetec.Data.SqlClient.ManagedIdentity (>= 1.0.0)
- Synetec.Notifications (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Adds capability for a user to receive an invitation even if they have never received one.