Failed to authorize in multitenancy keycloak with credentials

I was trying to follow the same multitenancy setup as the official documentation, but with credentials in my keycloak.json file, but keycloak does not seem to authorize access token properly.

It appears to call the resolve function of my customized KeycloakConfigResolver multiple times. It does authorize the token at the first time it calls to resolve, but it then shows ‘Failed to verify token’ every time after that.

And at the end, it fails to verify my access token.

The details are posted on stackoverflow and github issue.

Could someone please help me out of the multitenancy setup with credentials? Thanks

See my answer on stackoverflow