NgKeycloak
-
This is a simple library that provides capability to enable Keycloak Open-Id connect REST Login, Logout and Check Session.
-
It is developed using Angular >=8.0.0 and its newly introduced ng g library schematics. Library location: projects/ng-keycloak directory of this repository.
Examples/Demo
-
A simple Example can be found under src/app directory of this repository. You can update the keycloak configuration with yours in the app/shared/config location.
-
In case your keycloak server is on different domain use angular proxy-config to run the project with redirect to the keycloak server and provide BASE_URL = '' in the keycloakConfig when setting the library configuration and redirect the /auth api requests to your keycloak server using proxy config.
-
You can find sample proxy config file in the src/ directory of this repository.
Installation
npm i ng-keycloak
API
import { NgKeycloakModule } from 'ng-keycloak';
Usage
// Register the NgKeycloakModule in your app module.; ;;;
Use the import NgKeycloakService in your component.
;;
Credits
This project is based on keycloak openid connect REST API interface. This is the first library developed my me in the Angular community with motivation from my friend Akshay Jain. Also want to thank the entire Angular team for creating this awesome framework.
Running the example in local env
-
npm i
-
Run
ng serve
for a dev server and running the demo app. Navigate tohttp://localhost:4200/
. The app will automatically reload if you change any of the source files. -
Also you need to add your keycloak configuration before you can test the application.
NgKeycloak
This library was generated with Angular CLI version 8.1.3.
Services
For web development and related services visit us at: https://developershive.com Mail us at: contact@developershive.com
Author
Name: Tofiq Quadri Email: tofiqquadri@developershive.com