External Authentication callback ignores the tenant's own database and uses the default database
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