#What is the best way to authenticate NestJS with keycloak?
4 messages · Page 1 of 1 (latest)
Maybe a little late now but I found this package: https://www.npmjs.com/package/nest-keycloak-connect
Have not used it on my own yet but it seems to address what you asked for 🙂
Yeah, well....the nest-keycloak-connect package isn't for authentication, it's for leveraging Keycloak's authorization features. So, I doubt it will help for this inquiry. The keycloak-passport strategy is more likely what is needed. There are also a number of OIDC strategies, which should also work. But, it seems the passport-strategy looks more specialized for Keycloak i.e. it supports realms for multi-tenancy, whereas realms aren't a good multi-tenancy concept in Keycloak. So.... YMMV.