NotificationHandler renew token client credentials

Hello

I do have an implementation of server side application with NotificationHandler subscriptions for multiple agents topic. It is a ClientCredentials oauth client.

All works fine with receiving notification up to channel 24 hours expiration. I do know that channel is valid 24hours and I do have to resubscribe.

Problem is with adding/removing subscriptions after API token expires.
Scenario is:

  • start notification handler
  • subscribe for notifications
  • channel timeout is 24 hours
  • token expires in 1 hour
  • adding/removing new subscriptions isn't possible with old instance of an handler, because notification API token behind it isn't valid anymore.

Is there any way to add/remove subscriptions to handler without disconnecting/connecting handler after token expiration?

Recently I have to schedule disconnect/connect handler and resubscribe all agents to new channel to avoid 401 unauthorized error in add/remove subscription with handler create with NotificationAPI that has already expired token.

Thank you
Robert