Finbuckle.MultiTenant
Finbuckle.MultiTenant copied to clipboard
PerTenantAuthentication with Keycloak
Hi, I am currently trying to integrate the package into our project (Blazor Server Side). I want each tenant to use a realm in keycloak for authentication.
Now I have the problem that I don't know how exactly to configure the whole thing.
I managed to call my tenants with tenant1.url, works great. But now I don't know what to do.
I tried to follow the following example
My problem is that if I add this
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie()
.AddOpenIdConnect();
This is how i configured it at the moment
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie();
builder.Services.AddMultiTenant<TenantInfo>()
.WithHostStrategy()
.WithConfigurationStore()
.WithRemoteAuthenticationCallbackStrategy();
I get the error that the ClientId is not set. I use the appSettings.json file mentioned on the page as an example.
Maybe I have a misunderstanding here, but how does the openID Connect login page work? I have not found in the docs, but perhaps also overlooked. Maybesome someone can point me in the right direction :)
Best regards
Hi, take a look at this older sample: https://github.com/Finbuckle/Finbuckle.MultiTenant/tree/v6.9.0/samples/ASP.NET%20Core%203/PerTenantAuthenticationSample
Check the app pipeline config and and the user of 'WithPerTenantAuthentication. You'll see in the
appsettings.jsonthat each tenant has some properties that
WithPerTenantAuthentication` will use by convention to set their specific OpenId Connect settings.