Abdullah Khan
Abdullah Khan

Reputation: 49

Callback to client app after sign out - Identity server 4

I am trying to callback a .net framework client action method after sign out. For this I am trying to send a PostLogoutRedirectUri from a client on sign out. Problem I am facing is when suppose I have two .net framework clients A and B on a same browser. If I log in from client A and try to logout from a same client I am able to get PostLogoutRedirectUri in identity server 4 LogOut due to correct id_token but When log in from client A and I try to logout from client B (already logged in and authorized) due to the different id_token of client A PostLogoutRedirectUri and LogOutId is null in identity server LogOut. Below are the screenshots of my code and what i am trying to do:

  1. Log Out on client App enter image description here

Client A

  1. Client's Startup.cs enter image description here

  2. Identity server's config enter image description here

Client B

  1. Client's Startup.cs enter image description here

  2. Identity server's config enter image description here

Scenarios

  1. Login From Client A and Logout from same Client screenshot identity server Logout enter image description here

  2. Login From Client A, open Client B (authorized) and logout from Client B screenshot identity server Logout enter image description here

Upvotes: 1

Views: 675

Answers (1)

Abdullah Khan
Abdullah Khan

Reputation: 49

The problem was that client A and client B where using a same cookie generated by whichever client logins first. Cookie was being shared between both clients because both clients were running on same domain which is localhost so due to the same domain of different clients only single cookie was being generated. It was solved by giving cookie a different name in startup.cs of every client.

Upvotes: 1

Related Questions