# \#adapter-nodejs

**URL:** https://forum.keycloak.org/tag/adapter-nodejs/61.md

[Latest](https://forum.keycloak.org/latest.md) · [Categories](https://forum.keycloak.org/categories.md) · [Tags](https://forum.keycloak.org/tags.md)

---

## [Why is the keycloak instance not returned corectly using a pinia store (keycloak-js)?](https://forum.keycloak.org/t/why-is-the-keycloak-instance-not-returned-corectly-using-a-pinia-store-keycloak-js/28493)

<div class="topic-metadata">

**Author:** [@lammer-technikum](https://forum.keycloak.org/u/lammer-technikum)\
**Replies:** 1\
**Last updated:** [October 28, 2024, 1:19pm UTC](https://forum.keycloak.org/t/why-is-the-keycloak-instance-not-returned-corectly-using-a-pinia-store-keycloak-js/28493 "2024-10-28T13:19:25Z")

</div>

Here is a code part of my pinia store, with which I try to abstract the authentication: The code works for authentication, and I can read the token in other parts via useAuthStore.istance.token correctly. export cons…

---

## [Which package to use to integrate Keycloak with node js/ express js (es5)](https://forum.keycloak.org/t/which-package-to-use-to-integrate-keycloak-with-node-js-express-js-es5/18897)

<div class="topic-metadata">

**Author:** [@Nilesh](https://forum.keycloak.org/u/Nilesh)\
**Replies:** 0\
**Last updated:** [December 9, 2022, 9:54am UTC](https://forum.keycloak.org/t/which-package-to-use-to-integrate-keycloak-with-node-js-express-js-es5/18897 "2022-12-09T09:54:53Z")

</div>

Hi I want to integrate Keycloak with node/express js project which is built in ES5. Below are some of my findings. keycloak-connect - This was the best option but, I cannot use this package as it is deprecated. openi…

---

## [Adding Listener on Keycloak instance in node js](https://forum.keycloak.org/t/adding-listener-on-keycloak-instance-in-node-js/16794)

<div class="topic-metadata">

**Author:** [@AKaloun](https://forum.keycloak.org/u/AKaloun)\
**Replies:** 0\
**Last updated:** [August 8, 2022, 9:28am UTC](https://forum.keycloak.org/t/adding-listener-on-keycloak-instance-in-node-js/16794 "2022-08-08T09:28:17Z")

</div>

Hi, I would like to add multiple listener in my keycloak instance for example onClientRemoved Listener in my Node js project: https://www.keycloak.org/docs-api/17.0/javadocs/org/keycloak/models/UserSessionProvider.html…

---

## [MemoryStore: connect.session() MemoryStore is not designed for a production environment workaround](https://forum.keycloak.org/t/memorystore-connect-session-memorystore-is-not-designed-for-a-production-environment-workaround/15520)

<div class="topic-metadata">

**Author:** [@nrl240](https://forum.keycloak.org/u/nrl240)\
**Replies:** 0\
**Last updated:** [May 12, 2022, 10:39pm UTC](https://forum.keycloak.org/t/memorystore-connect-session-memorystore-is-not-designed-for-a-production-environment-workaround/15520 "2022-05-12T22:39:13Z")

</div>

Hey, y’all! I’ve inherited an app that uses Keycloak, and I’m a bit skeptical about the current implementation. As it stands, I’m seeing the following warning in the logs on production: Warning: connect.session() Memor…

---

## [Nodejs Confidential Rest-Api w/ Permissions - Always 403s - What Am I Doing Wrong?](https://forum.keycloak.org/t/nodejs-confidential-rest-api-w-permissions-always-403s-what-am-i-doing-wrong/14871)

<div class="topic-metadata">

**Author:** [@shane-js](https://forum.keycloak.org/u/shane-js)\
**Replies:** 0\
**Last updated:** [April 8, 2022, 8:16pm UTC](https://forum.keycloak.org/t/nodejs-confidential-rest-api-w-permissions-always-403s-what-am-i-doing-wrong/14871 "2022-04-08T20:16:40Z")

</div>

Hi Everyone, I’ve tried for many hours now and seem to have hit a wall. Any advice/help would be appreciated. Goal: I want to authorize the express rest-api (ex client-id: “my-rest-api”) routes (example resource: “Wea…

---

## [Enforcing routes based on URL parameter](https://forum.keycloak.org/t/enforcing-routes-based-on-url-parameter/4144)

<div class="topic-metadata">

**Author:** [@robertwinter](https://forum.keycloak.org/u/robertwinter)\
**Replies:** 1\
**Last updated:** [February 18, 2022, 7:49pm UTC](https://forum.keycloak.org/t/enforcing-routes-based-on-url-parameter/4144 "2022-02-18T19:49:41Z")

</div>

Hi, How can I use keycloak.enforce() based on an parameter provided in the URL? The Keycloak server is set up so that if I send a hardcoded resource ID to keycloak.enforcer(), it enforces correctly. How can I get it to…

---

## [400 with keycloak-admin and connecting via client-id and client-secret, in NodeJS?](https://forum.keycloak.org/t/400-with-keycloak-admin-and-connecting-via-client-id-and-client-secret-in-nodejs/8172)

<div class="topic-metadata">

**Author:** [@ajmas](https://forum.keycloak.org/u/ajmas)\
**Replies:** 1\
**Last updated:** [January 20, 2022, 10:58am UTC](https://forum.keycloak.org/t/400-with-keycloak-admin-and-connecting-via-client-id-and-client-secret-in-nodejs/8172 "2022-01-20T10:58:22Z")

</div>

I have created a client in keycloak that will be used by our staff account server. We then try connecting to our keycloak server from a NodeJS app, using ‘keycloak-admin’, but in doing so we get a 400 error. In Keycloak…

---

## [Securing ExpressJS without Bearer Tokens](https://forum.keycloak.org/t/securing-expressjs-without-bearer-tokens/12025)

<div class="topic-metadata">

**Author:** [@squawkdirty](https://forum.keycloak.org/u/squawkdirty)\
**Replies:** 0\
**Last updated:** [November 11, 2021, 8:57am UTC](https://forum.keycloak.org/t/securing-expressjs-without-bearer-tokens/12025 "2021-11-11T08:57:16Z")

</div>

Hello together. I struggle with setting up authentication for my application in the way I’d wish it to work. Therefore I hope for some input from you, whether what I want to achieve is feasible at all and if so - what I…

---

## [Keycloak sends 403 Access Denied with NodeJS Adapter](https://forum.keycloak.org/t/keycloak-sends-403-access-denied-with-nodejs-adapter/1660)

<div class="topic-metadata">

**Author:** [@luisRios](https://forum.keycloak.org/u/luisRios)\
**Replies:** 10\
**Last updated:** [November 3, 2021, 7:16pm UTC](https://forum.keycloak.org/t/keycloak-sends-403-access-denied-with-nodejs-adapter/1660 "2021-11-03T19:16:01Z")

</div>

Hi! I have a simple NodeJS application which I’d like to protect with keycloak-connect, but everytime returns a 403 - Access Denied error. I have done all the tutorials i’ve found (same code, same keycloack and node ver…

---

## [Path-cache of enforcing in keycloak nodejs adapter do not working](https://forum.keycloak.org/t/path-cache-of-enforcing-in-keycloak-nodejs-adapter-do-not-working/11252)

<div class="topic-metadata">

**Author:** [@lytuan99](https://forum.keycloak.org/u/lytuan99)\
**Replies:** 0\
**Last updated:** [September 30, 2021, 8:28am UTC](https://forum.keycloak.org/t/path-cache-of-enforcing-in-keycloak-nodejs-adapter-do-not-working/11252 "2021-09-30T08:28:03Z")

</div>

Acctually, I didn’t see any code about caching paths with protected sources like document of keycloak said here. My services always request the keycloak server to evaluate permission. How do I cache resources with lifes…

---

## [How to configure routes for authentication w keycloak, nodejs and UI5](https://forum.keycloak.org/t/how-to-configure-routes-for-authentication-w-keycloak-nodejs-and-ui5/10913)

<div class="topic-metadata">

**Author:** [@hawkroller](https://forum.keycloak.org/u/hawkroller)\
**Replies:** 0\
**Last updated:** [September 8, 2021, 3:08pm UTC](https://forum.keycloak.org/t/how-to-configure-routes-for-authentication-w-keycloak-nodejs-and-ui5/10913 "2021-09-08T15:08:58Z")

</div>

How do you configure a routes for a nodejs backend and ui5 frontend application? I have a UI5 frontend with like login, logout and other functions and i want to redirect all traffic through keycloak and then upon succes…

---

## [Best practice for registration endpoints](https://forum.keycloak.org/t/best-practice-for-registration-endpoints/3737)

<div class="topic-metadata">

**Author:** [@gilesdring](https://forum.keycloak.org/u/gilesdring)\
**Replies:** 0\
**Last updated:** [July 11, 2020, 6:09pm UTC](https://forum.keycloak.org/t/best-practice-for-registration-endpoints/3737 "2020-07-11T18:09:28Z")

</div>

I’m securing a Node.JS / NestJS using Passport and an OIDC Strategy. I’m wondering how best to provide a registration endpoint whilst still keeping within the libraries. I came up with a thought that I could create two …

---

## [User logged in but, access denied thrown by node adapter](https://forum.keycloak.org/t/user-logged-in-but-access-denied-thrown-by-node-adapter/1153)

<div class="topic-metadata">

**Author:** [@ghostpc](https://forum.keycloak.org/u/ghostpc)\
**Replies:** 0\
**Last updated:** [February 4, 2020, 1:38pm UTC](https://forum.keycloak.org/t/user-logged-in-but-access-denied-thrown-by-node-adapter/1153 "2020-02-04T13:38:29Z")

</div>

Was creating a simple protected route in a node.js app using the node adapter. I was using the following https://codeburst.io/keycloak-and-express-7c71693d507a tutorial. When the user logs in a session is created for the…

---

## [Kcinit for a Node application](https://forum.keycloak.org/t/kcinit-for-a-node-application/393)

<div class="topic-metadata">

**Author:** [@atoulme](https://forum.keycloak.org/u/atoulme)\
**Replies:** 1\
**Last updated:** [December 5, 2019, 9:55pm UTC](https://forum.keycloak.org/t/kcinit-for-a-node-application/393 "2019-12-05T21:55:36Z")

</div>

Hello all, I was looking at the kcinit library in Go, and am looking to get essentially the same functionality working for a Node.js application that runs as a CLI. Is there a way to achieve that with the existing keyc…
