Questions tagged [keycloak-nodejs-connect]

56 questions
2
votes
0 answers

keycloak provides different issuer for frontend and backend

I am new to keycloak, I am using keycloak for both frontend and backend application but I am getting the different issuer in the token generated by keycloak when decoded in jwt.io. Front end: the issuer is the same as the base URL of the frontend…
devanathan
  • 768
  • 3
  • 10
  • 39
1
vote
1 answer

keycloak - No 'Access-Control-Allow-Origin' header is present on the requested resource

We are facing issue in accessing nodejs app from chrome for which keycloak is configured. Keycloak version: 21.0.1 We are trying to access http://localhost:3101/graphql from chrome and it show below error from browser console. Access to fetch at…
Raushan
  • 307
  • 3
  • 12
1
vote
1 answer

calling keycloak everytime from API server to fetch Authorization info

I have Frontend application (spa) and this is calling rest api server. As I need Authorization enabled, I have to create two client in Keycloak i.e. frontend(public) and backend(confidential). I am passing an Access token fetched by frontend from…
1
vote
1 answer

keycloak and nodejs (nestjs), wrong role mismatch

I'm using nestjs-keycloak-connect module in multi-tenant mode. The log shows everything is correct but Resource denied due to mismatched role(s). The example controller: @Controller(':company') @UseGuards(AuthGuard, RoleGuard) export class…
1
vote
1 answer

Passing Keycloak bearer token to express backend?

We have a frontend application that uses Vue3 and a backend that uses nodejs+express. We are trying to make it so once the frontend application is authorised by keycloak it can then pass a bearer token to the backend (which is also protected by…
Andre M
  • 6,649
  • 7
  • 52
  • 93
1
vote
0 answers

Keycloak Node.JS without sessions

I'm trying to implement keycloak authentication on a NodeJS with Keycloak. I want to use JWT into the Authorization request header or in a request cookie. I follewed the doc but it uses express-session. So the request does not contains JWT but the…
1
vote
1 answer

Keycloak Bearer only nodejs adapter returns 403

i'm running keycloak 15.0.2 together with a react application and a node-js backend service in kubernetes. I have 2 clients, one is public (react-frontend) and the other one is bearer-only (service-backend), nothing fancy. Now i'm logging in and…
Memo
  • 21
  • 2
1
vote
2 answers

How to extend AuthGaurd Class Imported from 'nest-keycloak-connect'

I am using nest-keycloak-connect in nestjs and I want to create my own class extends from AuthGuard class for some custom functionality I tried and it works well @Injectable() export class KeycloakAuthGuard extends AuthGuard implements…
1
vote
1 answer

Add Keycloak to express server to get kauth from request

I am trying to add Keycloak authentication to my ApolloServer using keycloak-connect. I have setup my realm and login from localhost:8080/auth. However, I am having an issue getting kauth from my requests in the context function: Currently I have…
ashes999
  • 1,234
  • 1
  • 12
  • 36
1
vote
2 answers

Keycloak - 500 Internal Server Error- when validating a token generated by a confidential client

In the Keycloak server, we created a client that has an Access Type of confidential. By calling /protocol/openid-connect/token endpoint with the client_id and the client_secret, we got the access_token, which was supposed to authenticate the…
1
vote
1 answer

if the keycloak session expired, How do I redirect to login page?

I'm trying to implement keycloak on my node.js apps. I'm using keycloak-nodejs-connect on my node.js apps. If there is no operation on the website for longer than session idle time, I would like to automatically go to the login page or notify the…
user3371918
  • 13
  • 1
  • 4
1
vote
0 answers

Pass Keycloak auth token from NodeJS to React app

I have a ReactJS app with axios running on top of a NodeJS backend. I also have a local Keycloak server to enable single sign on (sso) and authentication. On the NodeJS backend I configured Keycloak Adapater as: (...other imports...) const session =…
dazito
  • 7,740
  • 15
  • 75
  • 117
1
vote
1 answer

keycloak logout doesn't invalidate token when call a rest api

I've a React app that uses Keycloak as a authentication service. Also I've a Nodejs rest api with endpoints secured by keycloak, so the React app sends JWT when needs call an api. In Keycloak admin console I created 1 public client with users and…
Hector
  • 691
  • 2
  • 14
  • 28
1
vote
0 answers

Keycloak - Dynamic Registration URLs

I trying to implement a way to efficiently manage several thousand users in a keycloak cluster somewhat automatically. I am wondering if there is a way for a user with higher credentials to generate a registration link containing url parameters that…
Andy
  • 708
  • 1
  • 11
  • 32
1
vote
1 answer

Keycloak node.js adapter doesn't invalidate connect.sid session cookie on logout

Node.js keycloak-nodejs-connect adapter (version 4.3) is used in an application gateway for protecting microservices' endpoints according to docs: var session = require('express-session'); var Keycloak = require('keycloak-connect'); var…