IdentityServer4.Admin icon indicating copy to clipboard operation
IdentityServer4.Admin copied to clipboard

How we can setup that when the user logs out it should redirect to the root of the application user come from

Open Munde opened this issue 6 years ago • 3 comments

we have tried to set the both the Back Channel Logout Uri and Front Channel Logout Uri with no luck we have been scratching our heads as one of application requirement during user initial registration is required to logout at least twice and whenever he logs out its stays on the STS logout page..

Munde avatar May 01 '19 01:05 Munde

Take a look at PostLogoutRedirectUri and AutomaticRedirectAfterSignOut in LoggedOutViewModel.

skoruba avatar May 03 '19 14:05 skoruba

we tried to put something like https://localhost:44307/signout-callback-oidc on PostLogoutRedirectUri but still we nothing happens

Munde avatar May 04 '19 00:05 Munde

I have resolved this question as follows: in AccountController (STS project) -> Method

BuildLoggedOutViewModelAsync(string logoutId)
{
            var vm = new LoggedOutViewModel
            {
                AutomaticRedirectAfterSignOut = !string.IsNullOrWhiteSpace(logout?.PostLogoutRedirectUri),
                _//AccountOptions.AutomaticRedirectAfterSignOut,_
                PostLogoutRedirectUri = logout?.PostLogoutRedirectUri,
                ClientName = string.IsNullOrEmpty(logout?.ClientName) ? logout?.ClientId : logout?.ClientName,
                SignOutIframeUrl = logout?.SignOutIFrameUrl,
                LogoutId = logoutId
            };
...

I did not find a place where the AutomaticRedirectAfterSignOut is set, but by default it is -false and if client have in settings Post Logout Redirect Uris -> I set Automatic redirect

Platonenkov avatar Apr 30 '21 06:04 Platonenkov