Webpage Not Available In Cordova Android App
Solution 1:
I don't understand why do you think that could be due to a wildfly configuration...
Check please and provide more info:
- Trace your request from Cordova to Keycloak
- What redirect_uri parameter is sent/requested?
- You can try enabling audit like this audit configuration to check the "redirect_uri" parameter.
Keycloak receives a request with a valid redirect uri and then if you are a valid user and the redirect uri received matches with your client configuration... your app will be redirected to your requested redirect_uri.
- Check your client and realm configuration (example realm configuration for cordova apps)
Edited 1: about your wildfly standalone.xml: As I said before in comments, your http-listener attribute reditect-socket=“http” is a mistake. If you want to enable redirection to https replace “http” by “https”. Otherwise remove it.
Attribute “proxy-address-forwarding” must to be used only when your keycloak are behind a reverse proxy (use of x-forwarded-* headers).
I tested with Keycloak v6.0.1 and it works. It redirect to 'http://localhost'.
Some points to take in mind:
- don't work with platform 'browser' (use 'android')
- adding 'inappbrowser' and 'whitelist' plugins
- try with a new emulator/runtime instance.
- don't tried with an external identity provider
Tested with Keycloak v6.0.1
Steps that I followed to do a test with sample project:
- Download Keycloak source from github source
- Install last version of Android Studio and Gradle (add to PATH)
- Go to directory 'keycloak/examples/cordova'
- Download 'keycloak.js' from your Keycloak instance (eg. 'https://yourdomain:port/auth/js/keycloak.js') and put in directory 'keycloak/examples/cordova/www'
- Open your emulator from Android Studio (install your runtime eg. 'Pixel 2 Api 29').
- Configure your realm 'example' (import new realm from file: 'keycloak/examples/cordova/example-realm.json')
- Run commands:
mkdir platforms plugins cordova plugin add cordova-plugin-inappbrowser cordova plugin add cordova-plugin-whitelist cordova platform add android cordova build android cordova run android
PS: If you have some public test instance to check with it or
Solution 2:
You'd likely need cordova-plugin-http2 or Cordova Advanced HTTP 2, because of enable-http2="true"
, the server wants to negotiate HTTP2
. Setting enable-http2="false"
would possibly circumvent the problem.
Post a Comment for "Webpage Not Available In Cordova Android App"