Open abhishekp21 opened 3 months ago
Hi, this is something I've done before and found it worked pretty well. I recommend using the regular IdentityDbContext with a many-to-many relationship between users and tenants rather than MultiTenantIdentityDbContext
because then a single user cannot belong to multiple tenants as easily and also because you won't know the tenant yet when you need to use the db context.
Then I've stored the default tenant in a user claim or alternatively you could add it as a property on your custom user entity class.
I am working on project based on https://github.com/fullstackhero/dotnet-starter-kit
I have a scenario where user belongs to multiple tenants but I want to collect only the username and password on the login screen, without requiring tenant at that stage. Instead, I want to retrieve the user's default tenant from the UserManager (user table) and generate the token. However, since Finbuckle is implemented, it expects tenant information during the authentication process, which is leading to issues with token generation. Could you help me resolve this?