Nodejs express router and get api Authentication Using Keycloak
Im going to explain in this post how to setup keycloak to protect your express router and get apis. first of all lets dig little bit around keycloak and express. Keycloak is an open source identity and access management solution that makes it easy to secure applications or microservices with little to no code. Express is a minimal and flexible Node.js web application framework. Setup Keycloak Server. 1. Download Keycloak docker file 2. Run Keycloak docker image. docker run -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -p 8080:8080 jboss/keycloak 3. Access to keycloak using this url http://localhost:8080/auth/ User name and pass word is : admin 4. Create a new Realm. Ex: "express-demo". 5. Under created realm create a client. Ex : "express-work-demo" . 6. under setting tab provide these details. client protocol = openid-connect access type = public valid redirect urls = http://localhost:8000/* 7. Once the client is created click the Instal