Identity.Base.ServicePrincipals
0.9.3
dotnet add package Identity.Base.ServicePrincipals --version 0.9.3
NuGet\Install-Package Identity.Base.ServicePrincipals -Version 0.9.3
<PackageReference Include="Identity.Base.ServicePrincipals" Version="0.9.3" />
<PackageVersion Include="Identity.Base.ServicePrincipals" Version="0.9.3" />
<PackageReference Include="Identity.Base.ServicePrincipals" />
paket add Identity.Base.ServicePrincipals --version 0.9.3
#r "nuget: Identity.Base.ServicePrincipals, 0.9.3"
#:package Identity.Base.ServicePrincipals@0.9.3
#addin nuget:?package=Identity.Base.ServicePrincipals&version=0.9.3
#tool nuget:?package=Identity.Base.ServicePrincipals&version=0.9.3
Identity.Base.ServicePrincipals
Full setup, endpoint, token, SDK, migration, and operational documentation lives at docs/packages/identity-base-service-principals/index.md.
Opt-in managed machine identities for Identity Base:
- immutable generated client IDs and
Guidsubjects; - multiple independently revocable, one-time-returned credentials;
- global RBAC role assignments and
identity.permissionsclaims; - short-lived OAuth 2.0
client_credentialsaccess tokens without refresh tokens; - token-entry revocation on disable and revoke-all;
- permission-protected admin APIs and typed client-core contracts.
Quick Start
var configureDbContext =
new Action<IServiceProvider, DbContextOptionsBuilder>((sp, options) =>
{
var connectionString = sp.GetRequiredService<IConfiguration>()
.GetConnectionString("Primary")
?? throw new InvalidOperationException("ConnectionStrings:Primary must be set.");
options.UseNpgsql(connectionString); // or UseSqlServer(connectionString)
});
builder.Services.AddIdentityBase(
builder.Configuration,
builder.Environment,
configureDbContext: configureDbContext);
builder.Services.AddIdentityAdmin(builder.Configuration, configureDbContext);
builder.Services.AddIdentityBaseServicePrincipals(
builder.Configuration,
configureDbContext);
var app = builder.Build();
app.MapApiEndpoints();
app.MapIdentityAdminEndpoints();
app.MapIdentityBaseServicePrincipalEndpoints();
Use separate delegates when a host needs different migrations assemblies or provider options for each context.
The host owns migrations for both ServicePrincipalDbContext and the extended IdentityRolesDbContext. Configure defaults under Identity:ServicePrincipals:
{
"Identity": {
"ServicePrincipals": {
"AccessTokenLifetime": "00:15:00",
"AllowedScopes": ["identity.api"]
}
}
}
Admin creation accepts a display name only. Identity Base generates the immutable client_id. Credential plaintext is returned once by the issue endpoint and only a salted hash is stored.
Managed clients coexist with legacy configuration-seeded client_credentials clients, which continue to use standard OpenIddict application secrets. Register IServicePrincipalLifecycleListener to enforce product-specific governance before disable.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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. |
-
net9.0
- Identity.Base (>= 0.9.3)
- Identity.Base.Admin (>= 0.9.3)
- Identity.Base.Roles (>= 0.9.3)
- Microsoft.EntityFrameworkCore (>= 9.0.10)
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.10)
- OpenIddict.Server (>= 7.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.