NestJS and FusionAuth
-
I want to use NestJS and FusionAuth together. How can I do so?
-
As far as NestJS, I am no expert, but I took a brief look and if I were in your shoes, I'd probably try the passport OIDC strategy.
https://docs.nestjs.com/security/authentication
https://www.npmjs.com/package/passport-oidc-strategy -
I am only new to this but could you not use the typescript client?
The passport-oidc-strategy seems abandoned.
There is this but there is no documentation:
https://github.com/mdwagner/next-great-idea/tree/master/nestjsThere are many guides on how to use Okta with NestJS such as
-
https://developer.okta.com/blog/2020/02/26/build-a-secure-nestjs-api-with-postgres
-
https://okta-blog.netlify.app/blog/2021/02/22/first-nestjs-application
-
https://slacker.ro/2021/03/15/build-a-secure-nestjs-back-end-for-your-react-application/
Even if FusionAuth is a better product, it just seems a lot easier to find information on Okta.
I had the same problem with https://www.ory.sh/ I just could not find any guides on how to integrate it.
-
-
Huh, yeah, that is weird. Not sure why there isn't a solid OIDC implementation for passportjs.
You could use the FusionAuth typescript client. It's open source; here's the github repo.
FusionAuth should be OIDC compliant so any NestJS example application that works with OIDC should be fine. Here are some posts to review:
- https://sdoxsee.github.io/blog/2020/02/05/cats-nest-nestjs-mongo-oidc.html#add-oidcstrategy
- https://github.com/Finastra/finastra-nodejs-libs/tree/develop/libs/oidc
- https://github.com/panva/node-oidc-provider (a node OIDC provider)
As for why you might want to avoid okta, I would just advise looking at the pricing page before committing.