Skip to content
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

EnablePostSignOutAutoRedirect = true #2519

Closed
vd3d opened this issue Dec 30, 2019 · 4 comments · Fixed by #2670
Closed

EnablePostSignOutAutoRedirect = true #2519

vd3d opened this issue Dec 30, 2019 · 4 comments · Fixed by #2670

Comments

@vd3d
Copy link

vd3d commented Dec 30, 2019

In the identity server, we have to set EnablePostSignOutAutoRedirect = true.

Currently, when we set PostLogoutRedirectUris to an URL, we are not redirected after logged out !

PS: I suppose it is the issue, can you confirm that ?

@hikalkan
Copy link
Member

Didn't try that. And now I don't know this is something to be done in the ABP framework, or with IDS4 configuration.
We will check. If you have time, you can check the logout source code and understand the problems and offer a solution (and send a PR if possible 😄).

@vd3d
Copy link
Author

vd3d commented Dec 31, 2019

I expect to add some PR one day, but I have to learn and play more with ABP first. Need a few month ;-)

@Alexbits
Copy link

Alexbits commented Jan 1, 2020

Hi @hikalkan, @vd3d. I have this problem as well

The LogoutController in Volo.Abp.Account.Web.Areas.Account.Controllers has to use IIdentityServerInteractionService to get PostLogoutRedirectUri

private readonly IIdentityServerInteractionService _interaction;

public LogoutController(SignInManager<IdentityUser> signInManager, IIdentityServerInteractionService interaction)
{
     _signInManager = signInManager;
     _interaction = interaction;
}

public async Task<IActionResult> Index(string returnUrl = null)
{
   await _signInManager.SignOutAsync();

   if (returnUrl != null)
   {
       return LocalRedirect(returnUrl);
   }
   else
   {
       var logoutId = Request.Query["logoutId"].ToString();

       if (!string.IsNullOrEmpty(logoutId))
       {
            var logoutContext = await _interaction.GetLogoutContextAsync(logoutId);

            var postLogoutUri = logoutContext.PostLogoutRedirectUri;

             if (!string.IsNullOrEmpty(postLogoutUri))
             {
                   return Redirect(postLogoutUri);
              }
         }
     }

   return RedirectToPage("/Account/Login");
}

@hikalkan hikalkan modified the milestones: backlog, 2.1 Jan 5, 2020
@hikalkan
Copy link
Member

hikalkan commented Jan 5, 2020

I moved this to v2.1 to consider to work on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants