-
-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per-Tenant Authentication with JwtBearerOptions Not Working #855
Comments
Added code for reference: Program.cs:
MultitenantJwtBearerEvents.cs:
|
Hi, this looks like a tough one. Just to check, do you mean to say "pre" tenant authentication or "per" tenant authentication? And the issue is only on validating the JWT token AFTER the whole oauth2 workflow has completed? One quick thing to try, place your |
Thank you for your quick reply. This is per tenant authentication, and there is an issue with JWT token validation. I tried your suggestion to place the AddAuthentication line before the AddMultiTenant, but it is returning the same result. |
So looking at this again, in the jwt scheme handler the challenge method doesn’t really do much before calling the event handler. If you tell it you handled the event (via your call to context HandledResponse) it will not generate the 401 challenge response because it assumes you have done so. Is that what you intended? In your top screenshot I can’t tell if the options passed to the challenge event were resolved correctly for the tenant. can you include that part in the screenshot? |
I am using Okta IDP provider, and it works with both static implementation and multitenancy using Finbuckle. However, the Per-tenant authentication with JwtBearerOptions flow does not function correctly on Finbuckle multitenancy with per-tenant authentication.
I have followed all the provided steps, and without per-tenant authentication, the tenant is resolved properly. Tenant information is obtained based on the Host Strategy. In JwtBearerEvents, during MessageReceived, I receive all options resolved by the ConfigurePerTenant method. However, during the Challenge method, I encounter an unusual result with no error message or description. I have included a screenshot of this issue.
The text was updated successfully, but these errors were encountered: