- ABP Framework version: v8.0.0
- UI Type: MVC
- Database System: EF Core (PostgreSQL)
- Tiered (for MVC) or Auth Server Separated (for Angular): yes
- Exception message and full stack trace:
- Steps to reproduce the issue:
I want to create Auth Server Which is tenant base and another 3 application which is tenant based and is used Auth Server for Authorization and authentication I want both running on tenant like tenant base is come from Auth Server and applicaton database configure as tenant base and also i want separate admins for different application which can be see specific tenants of application.
33 Answer(s)
-
0
hi
Your
ULBIDCDbContext
has replaced theIIdentityProDbContext
, so you have to access the Identity database viaDefault
connection string. -
0
then how can i change db context for Identity use AbpIdentityServer Database and for ULB use default connection string in Db Context?
-
0
hi
I suggest you use the same connection string for authserver and your application because they use the same DBContxt.
-
0
But i have Auth Server in different solution and application in different solution. i dont want to use same database because i have 3 other application also. i want Common Auth Server for all application so i want different database for Auth Server and Applications has their own database
-
0
Please check these document: https://docs.abp.io/en/abp/latest/Connection-Strings#configure-the-connection-strings https://docs.abp.io/en/abp/latest/Entity-Framework-Core#replace-other-dbcontextes
-
0
[ConnectionStringName("Default")] public class ULBIDCDbContext : AbpDbContext<ULBIDCDbContext> { public ULBIDCDbContext(DbContextOptions<ULBIDCDbContext> options) : base(options) {
} protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); /* Include modules to your migration db context */ builder.ConfigurePermissionManagement(); builder.ConfigureSettingManagement(); builder.ConfigureBackgroundJobs(); builder.ConfigureAuditLogging(); builder.ConfigureIdentityPro(); builder.ConfigureOpenIddictPro(); builder.ConfigureFeatureManagement(); builder.ConfigureLanguageManagement(); builder.ConfigureSaas(); builder.ConfigureTextTemplateManagement(); builder.ConfigureBlobStoring(); builder.ConfigureGdpr(); }
}
[ConnectionStringName("AbpIdentityServer")] [ReplaceDbContext(typeof(IIdentityProDbContext))] [ReplaceDbContext(typeof(ISaasDbContext))] public class IdentityServerDbContext : AbpDbContext<IdentityServerDbContext>, IIdentityProDbContext, ISaasDbContext { public IdentityServerDbContext(DbContextOptions<IdentityServerDbContext> options) : base(options) {
} #region Entities from the modules // Identity public DbSet<IdentityUser> Users { get; set; } public DbSet<IdentityRole> Roles { get; set; } public DbSet<IdentityClaimType> ClaimTypes { get; set; } public DbSet<OrganizationUnit> OrganizationUnits { get; set; } public DbSet<IdentitySecurityLog> SecurityLogs { get; set; } public DbSet<IdentityLinkUser> LinkUsers { get; set; } public DbSet<IdentityUserDelegation> UserDelegations { get; set; } // SaaS public DbSet<Tenant> Tenants { get; set; } public DbSet<Edition> Editions { get; set; } public DbSet<TenantConnectionString> TenantConnectionStrings { get; set; } #endregion
}
like this?
its works but when i logged in in application its not show the logout and other options in menu its only show personal data option.
-
0
hi
Please create mvc tiered project then check the
MyProjectNameMenuContributor
of web project.You need to add the menu yourself
abp new BookStore --tiered
-
0
Ok Thank you for support. its works.