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
                    
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="Identity.Base.ServicePrincipals" Version="0.9.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Identity.Base.ServicePrincipals" Version="0.9.3" />
                    
Directory.Packages.props
<PackageReference Include="Identity.Base.ServicePrincipals" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Identity.Base.ServicePrincipals --version 0.9.3
                    
#r "nuget: Identity.Base.ServicePrincipals, 0.9.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Identity.Base.ServicePrincipals@0.9.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Identity.Base.ServicePrincipals&version=0.9.3
                    
Install as a Cake Addin
#tool nuget:?package=Identity.Base.ServicePrincipals&version=0.9.3
                    
Install as a Cake Tool

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 Guid subjects;
  • multiple independently revocable, one-time-returned credentials;
  • global RBAC role assignments and identity.permissions claims;
  • short-lived OAuth 2.0 client_credentials access 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.9.3 97 7/27/2026
0.9.2 83 7/26/2026