I'm building an Angular (4) application and I'm trying to logout via IdentityServer 4.
Here's my UserManager config:
this.manager = new UserManager({
authority: "http://localhost:5000",
client_id: "angular_dev",
redirect_uri: "http://localhost:4200/login-callback",
response_type: "id_token token",
scope: "openid profile email",
loadUserInfo: true,
filterProtocolClaims: true
});
when the user clicks the logout button, I call:
async logoutAsync(){
return await this.manager.signoutRedirect();
}
This works fine when I'm on the main (http://localhost:4200) endpoint, however as soon as I'm on a sub-route (e.g. http://localhost:4200/admin), calling above method will do the following:
endsession endpoint (checked with fiddler)Any idea why this is happening?
Im using "oidc-client": "^1.3.0"
Check network trace. Do you redirect to the token server's end session endpoint at all?
From the working route "/" the redirection works just as expected, from the sub routes e.g. "/admin", no endpoints are hit at all. I just get redirected to "/"
Ok, second embarrassing issue in a day.
This was not a oidc-client issue. The button was in an anchor-tag and I forgot to call preventDefault().
Sorry for wasting your time.
Most helpful comment
Ok, second embarrassing issue in a day.
This was not a oidc-client issue. The button was in an anchor-tag and I forgot to call preventDefault().
Sorry for wasting your time.