There is another solution for that.
Look at:
And from my experience it works, but I haven’t tested it on newer versions of Keycloak.