Adding a way to pass in a custom adapter would be fine to add.
Thank you so much for that! This will help with so many issues and will
allow community (like myself) to experiment with different platforms like
I created PR to show what I mean:
Change is really small and do not affect any current api.
I'm just adding additional option to library that could be available for
advanced use cases.
I'm happy to do further improvements in this area, but that PR will be
resolving main extensibility problem.
However, what is it that you actually want? To extend the Cordova
support to also be able to use the native browser (i.e. custom tabs on
Idea is to be able to use keycloak.js adapter and configure it to match
some security recommendations for mobile devices.
The main thing is to avoid using hardcoded localhost url in redirects and
to be able to redirects with protocol that will launch the application:
could use `yourapp://...` protocol instead.
This requires some additional setup and may not be suitable to be done
directly in the keycloak.js adapter.
Having this option will be good to produce ultra secure Cordova application
template and work with other mobile cross platform tools that keycloak team
do not need to care about.
If so that's something we would like to have directly.
Happy to contribute that change, but this will mean that setup for Cordova
will become more complex (additional plugins will be needed)
This will involve much more documentation updates and I was worried if I
will suggest that option it could be really hard to get that merged.
I would say this could be phase 2 of this work where actual adapters will
be available outside keycloak.js class and then they could be passed to
Every adapter will require different arguments or even external plugins
(for Cordova etc.) and could have dedicated chapter in documentation.
To implement that for Cordova adapter an app identifier URL would also need
to be defined.
This will be used to perform redirects back to yourapp:// namespaces,
rather than just URL's.
On Thu, Mar 8, 2018 at 7:51 AM, Stian Thorgersen <sthorger(a)redhat.com>
Adding a way to pass in a custom adapter would be fine to add. I
this is already supported though, but need to check code to confirm that
(I'm travelling right now so can't do it now).
However, what is it that you actually want? To extend the Cordova support
to also be able to use the native browser (i.e. custom tabs on Android,
If so that's something we
would like to have directly.
On 5 March 2018 at 15:25, Wojciech Trocki <wtr(a)redhat.com> wrote:
> I have been using keycloak.js for more than year mainly with the mobile
> applications (Cordova).
> Library is pretty well designed however there are some minor limitations
> terms of what adapters could do.
> custom implementations for adapters.
> Additionally implementations are provided as objects so it's hard to see
> and conform this undocumented interface.
> I'm happy to contribute any changes that will make sense upstream.
> I have created issue to cover exact use case where this is needed:
> Adding this functionality will also make it trivial to implement support
> for different mobile platforms like ReactNative etc.
> keycloak-dev mailing list
Red Hat Mobile <https://www.redhat.com/>