IdP tells API "hey this token is not valid anymore"


I need to achieve the following scenerio:
I have a local keycloak server running ok with OIDC.
I have

  • realm
  • user
  • client

I need to somehow the IDP tells to my nodejs api, “hey I forced this X user to logout”, then somehow the IDP will send a POST request to my API endpoint something like http://myapi/api/v1/logout to make some proccess with the Id of the invalidated accessToken to persisit in some database.

Then the API tells the IDP “Okay, this token is not longer valid”. Then once the client uses its accessToken it will be notified.

How do I set||configure||tell the IDP(keycloak) to comunicate the http://myapi/api/v1/logout when the IDP has logged out the user???
Is there any text input to place this URL, is there any way I can test this very quick and simple?


Some way to have a very small express API and add some endpoint to the IDP and then when user is forced to logout we have a log in the API ?