Comments (4)
Have tried setting options.TenantType = TenantTypes.HierarchicalTenant | TenantTypes.AddSharding;
as well. With Hierarchical + Sharding we are able to create only top level and no child level.
Is Hierarchical tenancy and sharding mutually exclusive?
from authpermissions.aspnetcore.
Hi @pradeepgururani,
OK, you are trying to create a hierarchical multi-tenant in one database, which is fine (Example4 does this). The problem is you need to use the IAuthTenantAdminService
service. The IShardingOnlyTenantAddRemove
service is only for a sharding-only tenants.
from authpermissions.aspnetcore.
But we don't want only hierarchical multi-tenant. We want it with sharding support. We are fine with the premise that top level tenant alone will have own DBs and child level tenant will reside with their parent tenant db. In our case this is not working while using IAuthTenantAdminService.AddHierarchicalTenantAsync
.
The hasOwnDb parameter is true, but the sharding database name 'SignOn-20240120163734-870' already has tenant(s) using that database.
In your examples we couldn't find any example with hierarchical + sharding combination. We could use help from your side.
from authpermissions.aspnetcore.
I think you haven't understand the different services used for the two sharding approaches: hybrid and sharding-only sharding.
You have selected the hybrid approach so you should use the IAuthTenantAdminService service. The IShardingOnlyTenantAddRemove is only for the sharding-only type, so if you give it a tenant that shares a database then it will give you an error.
I recommend you read the article called The (long) journey to a better sharding multi-tenant application which explains that hybrid type has to have manually manages because a tenant's data might be in a database shared by other tenants, or it could have its own database. What I did find that the sharding-only type has only one way to work, so I created the IShardingOnlyTenantAddRemove
service to make it easier for the developer and admin user.
PS. If you are using Sign up for a new tenant, with versioning with the hybrid type, then you need to create a ISignUpGetShardingEntry
that can handle many tenants sharing one database AND tenants that have their own database. The Sign Up documentation has a section on the ISignUpGetShardingEntry
with examples
from authpermissions.aspnetcore.
Related Issues (20)
- Each Created Tenant should have Admin Role HOT 1
- Extend UsingEfCoreSqlServer to be able to influence DbContextOptionsBuilder HOT 2
- Having issue with permissions and claim HOT 3
- Custom rules for each tenant HOT 3
- `AddSuperUserToIndividualAccounts` doesn't seem to be working HOT 1
- AuthP working with Azure App Configuration HOT 1
- SignedUp User not able to assign the permissions for all the actions HOT 4
- Version conflict detected for Microsoft.CodeAnalysis.Common. Install/reference Microsoft.CodeAnalysis.Common 4.8.0 directly HOT 6
- SigningKey Property on AuthPJwtConfiguration doesn't support keys generated as byte[] HOT 4
- AuthP support for UserNames? HOT 4
- API using AuthP and AzureAd Token HOT 1
- Some claim changes ignored until logout/login HOT 3
- Enable Audit functionality on Tenant HOT 4
- ShardingServices - value cannot be null due to update to 5.0.1 HOT 6
- User access in multiple tenants HOT 4
- Support .NET 8 HOT 4
- The name of the database date can't be null HOT 15
- Soft Delete HOT 1
- Create admin user with tenant admin role HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from authpermissions.aspnetcore.