[keycloak-user] Poor/buggy TypeScript adapter implementation

Marcel Német Marcel.Nemet at gmail.com
Fri Apr 6 05:16:26 EDT 2018


At the moment, there are multiple projects on GitHub which try to bring
advanced Keycloak functionality into angular 2+ projects.

There are projects which are based on the official keycloak javascript
adapter (these projects copy files from or import the official javascript
adapter) for example :
https://github.com/ssilvert/keycloak-schematic (works with angular 2+)
and
https://github.com/mauriciovigolo/keycloak-angular (works with angular 4.3+
and provides the implementation for the great HttpInterceptor (angular
4.3+) in order to add bearer tokens to HTTP requests)

Both of these projects are missing the implementation of Authorization
flow, and it is not easy to implement this when one tries to use the
official Keycloak javascript adapter with TypeScript. For example,
KeycloakAuthorization returns undefined when constructed and does not
return an observable after executing async HTTP request to
/.well-known/uma-configuration .

There is another project:
https://github.com/ebondu/angular2-keycloak

which is not using the official keycloak javascript adapter. Instead, the
authors have rewritten the code from official JS adapter into TypeScript.
It seems to address issues which I was not able to solve with the official
javascript adapter. For example, it notifies the initialization of
Authorization object (see
https://github.com/ebondu/angular2-keycloak/blob/b8dd423fefc98305ac2f2f9efd1178020a8a2966/src/services/keycloak.auth.service.ts#L154
).

But this project is not updated as often as the official javascript
adapter. For example, it does not support uma2 which is coming with 4.0.0.

I believe it would be good to invest some effort into making the basic
keycloak javascript adapter working well with angular/typescript. There is
clearly interest in building good libraries, but these have to be based on
a working, official and updated basic adapter. One option would be to pull
the code from https://github.com/ebondu/angular2-keycloak. Or endorse some
working implementation for TypeScript.

issue: https://issues.jboss.org/browse/KEYCLOAK-7021

Best regards

-- 
Marcel Német
marcel.nemet at gmail.com


More information about the keycloak-user mailing list