I have a DunendeSoftware Identity Server (v5.0.0-preview2.13) running under ASPNetCore 5.0 and using HttpSys as the web server (no Kestrel or IIS). I have a second website (call it protectedsite) using implicit flow to authenicate to the Identity Server. It is also ASPNetCore 5.0 hosted in HttpSys. I can Login and make authenticated calls on my protectedsite. I can logout by calling a the following code in the protectedsite
[AllowAnonymous]
public IActionResult Logout ()
{
return SignOut(new AuthenticationProperties
{
RedirectUri = "/home/loggedout"
}, "Cookies", "oidc");
}
The problem comes in the call back to home/loggedout. The code in OpenIdConnectHandler.HandleSignOutCallbackAsync receives control anytime a request is made to home/Loggedout and the actual action is never invoked. The intercept is done after the Signout code in IDS completes AND even if I do https://ProtectedSite/Home/LoggedOut without even touching IDS.
It appears that OpenIdConnectHandler.HandleSignOutCallbackAsync will intercept any url that looks like OpenIdConnectOptions.SignedOutCallbackPath. If I remove SignedOutCallbackPath setting in my startup, then the request is not intercepted and the action runs, BUT then IDS declares my PostLogoutRedirectUri to be invalid because the default of https://protectedsite/signout-callback-oidc is not in the list of valid post logout urls.
At this point my bottom line problem is that I can either have a redirect from IDS to my protected site that does not really work (leaves a blank page on the screen) or I can forego the redirect to protectedsite and the standard Duende logout message is displayed while still on the Duende IDS site. I do not want the user left on the Duende site.
OIDC setup in protectedsite
AddOpenIdConnect("oidc", options =>
{
options.Authority = "https://IDS:443";
options.ClientId = "mvc";
options.ClientSecret = "secret";
options.GetClaimsFromUserInfoEndpoint = true;
options.ResponseType = "code";
options.SaveTokens = true;
options.Scope.Add("api1");
options.Scope.Add("offline_access");
options.Scope.Add("profile");
options.SignInScheme = "Cookies";
options.SignedOutCallbackPath =
Microsoft.AspNetCore.Http.PathString.FromUriComponent("/home/loggedout");
// options.SignedOutRedirectUri = "https://protectedsite/home/loggedout";
});