Is it possible to do a license check with keycloak

I am wondering if it is possible to use keycloak as a it is, but perform an additional check, to ensure the software license is genuine.

My first approach looks like this. Adapt the startup script of the keycloak server to first do the license check and start afterwards. So if the license is not valid the system will not start up and issue access tokens.

If the license is valid, keycloak starts up and is ready to serve tokens.

If you have any ideas, or you know how it can be done, please let me know.

Is this forum still alive?