[keycloak-dev] Javascript adapter: cordova implementation is broken

Alan Balbo alan.balbo at fairandsmart.com
Wed Apr 17 05:44:27 EDT 2019


Hi,

I found an issue in the javascript adapter (
*adapters/oidc/js/src/main/resources/keycloak.js*) : the "*cordova*"
implementation is broken, and is also inconsistent with the other
implementations provided (both "*default*" and "*cordova-native*"):

1) The *register* method (l. *1324*) does not take an "*options*"
parameter, even though it uses it two lines below. It causes the execution
to stop and throw an error, breaking the authentication process. This is an
error induced by commit *f6125a25* (KEYCLOAK-6655)
2) If we look at other implementations of the same method (l. *1171* and l.
*1389*), both return a promise. But the cordova implementation does not,
resulting in an inconsistency that I find weird. This is a big issue when
writing typescript services on top of it (e.g. keycloak-angular).

I would suggest a fix for those issues, as it makes the cordova
implementation unusable. First and foremost it should take an "options "
parameter and the function could be rewritten to be consistent with the
other implementations, i.e. making it return a promise and parsing the
callback properly.

Let me know what you think. Maybe it should be two distinct issues (one for
the bug and one for the promise).

Regards,
Alan


More information about the keycloak-dev mailing list