[keycloak-dev] Angular Integration

Giovanni Silva giovannicandido at outlook.com
Tue Apr 24 07:15:50 EDT 2018


Hi,
Based on the awesome work in keycloak-js, I created integration with Angular 2 (4, 5), one of the most wide used javascript frameworks.

The integration expands on a couple of different ways:

Provide directives for condition hide display DOM elements, based on user roles

Provide Login guards for angular routes that intercept a not logged user and initiate the Oauth2 flow

Provide a service to be injected for queries like username and email

Automatically refresh and add the token on every http request to server, without any intervention.

It can also be used in ionic mobile applications, but I did not test this.

If anyone is interested in the project, I would appreciate any feedback or collaboration.

Code is release in MIT license

What is missing:

Authorization service integration (there is only role based directives)

More user cases

Code: https://github.com/giovannicandido/angular-spa
Docs: https://angular-spa.netlify.com
Demo: https://github.com/giovannicandido/angular-spa-example

Thanks,
Giovanni Silva



More information about the keycloak-dev mailing list