Finbuckle / Finbuckle.MultiTenant

Finbuckle.MultiTenant is an open-source multitenancy middleware library for .NET. It enables tenant resolution, per-tenant app behavior, and per-tenant data isolation.
https://www.finbuckle.com/multitenant
Apache License 2.0
1.3k stars 265 forks source link

Usage with IdentityServer4 #197

Closed williambowsher closed 4 years ago

williambowsher commented 4 years ago

Firstly thank you for all your work on Finbuckle, makes my life a lot easier.

Now to my question: I have integrated my application with IdentityServer 4 and when a user is authenticated they are assigned a claim for the tenant they should be using, is there anyway of restricting the user to the tenant?

AndrewTriesToCode commented 4 years ago

Hi, I can give you a more detailed response later today, but this is an area I’m actively looking into.

How are you doing the user authentication in IdentityServer? Are you using Identity or something else?

williambowsher commented 4 years ago

Hi Andrew, I have now sorted all my issues, I am indeed using Identity and I have added a small API to the IdentityServer source code so I can automate the user sync, then I have the postback action check the claims for the tenant claim, I'd the tenant cla does not match the tenant returned from the http context then I remove the auth cookie and redirect to the proper tenant.

Everything else works perfectly.

Thanks for the great work.

On Tue, 5 Nov 2019, 19:13 Andrew White, notifications@github.com wrote:

Hi, I can give you a more detailed response later today, but this is an area I’m actively looking into.

How are you doing the user authentication in IdentityServer? Are you using Identity or something else?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Finbuckle/Finbuckle.MultiTenant/issues/197?email_source=notifications&email_token=AFICAZY7OUWQ7G3I2NFEXCDQSGZTJA5CNFSM4JIFLMNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDDY3WI#issuecomment-549948889, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFICAZZX2YJIGDFEALYND7LQSGZTJANCNFSM4JIFLMNA .

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.