How to configure the cross origins for a hybrid mobile app to access Keycloak; is it mandatory to enable localhost as allowed origins?

Hi,

Have already tried on both Stackoverflow and Github discussions without any luck. Could you please help on this. We are kind of blocked on this issue…

We are trying to trying to write a cordova mobile app that has to connect to our production keycloak instance. We followed the examples provided but both of the examples are expecting us to enable to allow origins for localhost.

Could you please advise if there is an alternate way? we cant enable localhost as allowed origin.
GIT discussion link: How to configure the cross origins for a hybrid mobile app to access Keycloak? is it mandatory to enable localhost as allowed origins? · keycloak/keycloak · Discussion #19218 · GitHub
Stackoverflow: security - Is there an other approach to Cordova and Cordova-native plugins are expecting to allow access for localhost while using Keycloak? - Stack Overflow
thanks in advance!