I am currently working with Identity server 4, where i am trying to enable BackChannelLogoutUri.
Each client has been given a BackChannelLogoutUri in the config of the client
BackChannelLogoutUri = "http://localhost:44322/home/LogoutBackChannel",
Each client application has registered the cookieEventHandler and LogoutSessionManager.
services.AddTransient<CookieEventHandler>();
services.AddSingleton<LogoutSessionManager>();
services.AddAuthentication(options =>
{
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = "oidc";
})
.AddCookie(options =>
{
options.ExpireTimeSpan = TimeSpan.FromMinutes(60);
options.Cookie.Name = "mvchybridbc";
options.EventsType = typeof(CookieEventHandler);
})
My logout view on the identity server contains the Iframe
@if (Model.PostLogoutRedirectUri != null)
{
<div>
Click <a class="PostLogoutRedirectUri" href="@Model.PostLogoutRedirectUri">here</a> to return to the
<span>@Model.ClientName</span> application.
</div>
}
@if (Model.SignOutIframeUrl != null)
{
<iframe width="0" height="0" class="signout" src="@Model.SignOutIframeUrl"></iframe>
}
This is all well and good. But my problem is that the BackChannelLogoutUri is a single url. When hosted it will need to be passed some how from each tennent
- "http://one.mysite.com/app1/home/LogoutBackChannel"
- "http://one.mysite.com/app2/home/LogoutBackChannel"
- "http://two.mysite.com/app1/home/LogoutBackChannel"
- "http://three.mysite.com/app3/home/LogoutBackChannel"
We cant really have a client for each tenant and app. That would be a lot of clients. That and clients that are only users of tenant one would not need to be logged out of tenant two.
I am not sure how to address this issue.