Invalid Redirect URI - Keycloak configuration for Ionic app

I have an Ionic app and I want use AA from Keycloak. When I test it on ionic-lab, I was using the localhost:8100 root uri. But, to use on the device, I received the error “Invalid Redirect URI”. Mobile apps are the own client, right? Each device is a client, unlike a Angular app that has a static address. So, what Root URL I set to create a client for these app?

Are you sure that you’ve enabled the cordova-inappbrowser plugin ?

When you try to login, the keycloak.js (Keycloak JavaScript Adapter) script open an InAppBrowser and listen for this event :

ref.addEventListener('loadstart', function(event) {
   if (event.url.indexOf('http://localhost') == 0) {
      var callback = parseCallback(event.url);
      processCallback(callback, promise);
      completed = true;

You can see that the ‘http://localhost’ is directly managed by keycloak.js .
So, when keycloak redirect to the ‘localhost’ url, the inAppBrowser is closed and the callback function is processed.