elsa-core/src/modules/Elsa.Identity
Sipke Schoorstra 550685ea3f
[codex] Add package manifest feature metadata (#7463)
* Add package manifest feature metadata

* Address package manifest review feedback

* Address structured log manifest defaults

* Use infrastructure attributes in manifests
2026-05-18 15:39:22 +02:00
..
Constants Multitenancy (#5159) 2024-06-10 21:30:53 +02:00
Contracts feat: extend shells integration and modular server support (#7399) 2026-04-18 14:33:34 +02:00
Endpoints feat: extend shells integration and modular server support (#7399) 2026-04-18 14:33:34 +02:00
Entities Remove Elsa.Expressions.Dsl module and related DSL features 2025-06-02 21:52:10 +02:00
Extensions Graceful shutdown for the workflow runtime (drain, pause, recover) (#7424) 2026-05-02 19:27:08 +02:00
Features Graceful shutdown for the workflow runtime (drain, pause, recover) (#7424) 2026-05-02 19:27:08 +02:00
HostedServices feat: extend shells integration and modular server support (#7399) 2026-04-18 14:33:34 +02:00
Models Introduce role and user management services (#7297) 2026-02-15 18:50:11 +01:00
Multitenancy Refactor Tenant Resolution to Use Async Local Storage for Operation-wide Access (#6022) 2024-10-12 12:08:09 +02:00
OptionConfigurators Graceful shutdown for the workflow runtime (drain, pause, recover) (#7424) 2026-05-02 19:27:08 +02:00
Options feat: extend shells integration and modular server support (#7399) 2026-04-18 14:33:34 +02:00
Providers Implement admin API key provider 2023-04-22 11:10:44 +02:00
Services feat: extend shells integration and modular server support (#7399) 2026-04-18 14:33:34 +02:00
ShellFeatures [codex] Add package manifest feature metadata (#7463) 2026-05-18 15:39:22 +02:00
Elsa.Identity.csproj Convert CShells project references to package references in Workflows and Identity modules. 2026-02-19 22:10:02 +01:00
FodyWeavers.xml
IdentityPolicyNames.cs feat: extend shells integration and modular server support (#7399) 2026-04-18 14:33:34 +02:00
README.md feat: extend shells integration and modular server support (#7399) 2026-04-18 14:33:34 +02:00

Elsa.Identity

Default Admin User Bootstrap

Elsa supports bootstrapping an initial admin role and user through the DefaultAdminUser feature.

This is the recommended way to initialize identity access now that user-management endpoints are permission-based and no longer rely on the SecurityRoot policy.

See doc/adr/0010-default-admin-user-bootstrap-for-initial-identity-access.md for the architectural decision.

When using shell-based configuration (CShells), configure the DefaultAdminUser shell feature.

Example (appsettings.json):

{
  "CShells": {
    "Shells": [
      {
        "Name": "Default",
        "Features": {
          "Identity": {
            "SigningKey": "CHANGE_ME_TO_A_SECURE_RANDOM_KEY"
          },
          "DefaultAuthentication": {},
          "DefaultAdminUser": {
            "AdminUserName": "admin",
            "AdminPassword": "password",
            "AdminRoleName": "admin",
            "AdminRolePermissions": ["*"]
          }
        }
      }
    ]
  }
}

This maps to Elsa.Identity.ShellFeatures.DefaultAdminUserFeature and configures DefaultAdminUserOptions at startup.

Legacy feature system (code-first)

When using the legacy feature system (module configuration in code), call UseDefaultAdmin while configuring Identity.

services.AddElsa(elsa =>
{
    elsa
        .UseIdentity(identity =>
        {
            identity.TokenOptions += options =>
            {
                options.SigningKey = "CHANGE_ME_TO_A_SECURE_RANDOM_KEY";
            };

            identity.UseDefaultAdmin(admin => admin
                .WithAdminUserName("admin")
                .WithAdminPassword("password")
                .WithAdminRoleName("admin")
                .WithAdminRolePermissions(new List<string> { "*" }));
        })
        .UseDefaultAuthentication();
});

You can also use the shorthand overload:

identity.UseDefaultAdmin("admin", "password", "admin", new List<string> { "*" });

Operational notes

  • The initializer is idempotent: existing admin role/user are not recreated.
  • Do not keep development defaults (admin / password) in production.
  • Prefer environment variables or a secret manager for admin credentials.
  • After first bootstrap, rotate credentials according to your security policy.