#8181·elsa-core

External Authentication callback ignores the tenant's own database and uses the default database

Author: JoPetraCreated Sep 17, 2026Updated Sep 19, 2026
Labelsbugpersistenceprio highelsa 3triaged

Version: Elsa 3.8.1 (Elsa.ExternalAuthentication 3.8.1), .NET 10

Setup

Multitenancy on. Tenant resolved from header, and resolving work fine. Every tenant have its own SQL database. The connection string is inside the tenant Configuration (ConnectionStrings:SqlServer), same like your helper TenantExtensions.GetConnectionString(tenant, name) in Elsa.Persistence.EFCore.Common. Our DbContextOptionsBuilder read the connection string from ITenantAccessor.Tenant:

ef.DbContextOptionsBuilder = (sp, db) => { var tenant = sp.GetRequiredService().Tenant; var connectionString = tenant?.Configuration.GetConnectionString("SqlServer"); db.UseSqlServer(connectionString ?? hostConnectionString); }; External Authentication with an Entra connection (openid-connect) and unlinkedPolicy = create-user.

Source: elsa-workflows/elsa-core