Search code examples
c#asp.net-coreidentityserver4oidc-client-js

How do you add parameters to an IdentityServer LogoutRequest model?


I'm using the Identity oidc-client-js library and calling

this.usermanager.signoutRedirect({ somedata: someObject.Id });

Then in the logout endpoint I do this with the IdentityServer interaction service

var logoutRequest= await _interaction.GetLogoutContextAsync(logoutId);

I would have expected the somedata to show up in the Parameters property of the LogoutRequest but it doesn't. So how do I add some extra parameters to the signout?

I noticed I can return a { state: 'somedata' } but I don't actually know how to retrieve that from the LogoutRequest object either. So if I can't add my own parameters how do I retrieve the state data?

Thanks!


Solution

  • you gotta do this

    this.usermanager.signoutRedirect({ extraQueryParams: { 'key': 'value' } });
    

    Then they'll show up in the Parameters property in the LogoutRequest