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

No post logout redirect ? #1

Open
SebiNUI opened this issue Apr 19, 2018 · 4 comments
Open

No post logout redirect ? #1

SebiNUI opened this issue Apr 19, 2018 · 4 comments
Labels
question Further information is requested

Comments

@SebiNUI
Copy link

SebiNUI commented Apr 19, 2018

@ThunderDev1 I'm trying to use the post logout redirect within a similar SPA client... I noticed you didn't follow the same approach. My question is: did you manage to make post logout redirect work ?

@ThunderDev1
Copy link
Owner

Unfortunately no, I didn't get it to work. I did research the issue and as you probably saw, other people seem to have problems making it work.. I'll try to look in to it again when I have the time

@SebiNUI
Copy link
Author

SebiNUI commented Apr 26, 2018

@ThunderDev1 I did, by creating the following method in the account controller:

[HttpGet]
[AllowAnonymous]
public async Task Logout(string logoutId)
{
var logout = await _interaction.GetLogoutContextAsync(logoutId);
await _signInManager.SignOutAsync();
_logger.LogInformation("User logged out.");
return Redirect(logout.PostLogoutRedirectUri);
}

@ThunderDev1 ThunderDev1 added the question Further information is requested label Aug 7, 2018
Repository owner deleted a comment from shamilaprabhath Sep 11, 2018
@floodi
Copy link

floodi commented Sep 6, 2019

I think id_token_hint should be used in logout-function(Spa - Nav.tsx):
const logout = (event: any) => {
event.preventDefault();
userManager.getUser()
.then(user => {
userManager.signoutRedirect({ 'id_token_hint': user.id_token });
});

userManager.removeUser();
};

@ThunderDev1
Copy link
Owner

Yes, that seems to be it, according to http://docs.identityserver.io/en/latest/endpoints/endsession.html you also need to pass the post_logout_redirect_uri. For some reason identity server is not providing the id_token, not sure what is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants