API gateway with Oauth2 fails to connect to Keycloak on public IP
Summary:
API GW throws error when fetching Oauth2 discovery URL:
"Unexpected response from the discovery endpoint uri: https://.../auth/realms/master/.well-known/openid-configuration. Make sure that the URI is accessible on the subnet of the gateway. Contact Oracle Support if the issue persists."
Content (required):
I have setup an API gateway in OCI and was able to make a call to a back-end API through it.
I then wanted to add Oauth2 authentication using a Keycloak service on a public IP, but the API GW fails to fetch the discovery URL (see error msg. above).
I see a similar issue when I configure a back-end API on a public IP (and with no authentication). The GW also cannot connect to the back-end on the public IP.