I am struggling with the same problem.
I threw together an example.
https://github.com/sandra-markerud/keycloak-sample
Start keycloak with a docker-compose file. Keycloak contains two realms, "external" and "internal".
I cannot make it work.
Any help would be appreciated