Search code examples
google-cloud-functionsnestjs

Authentication for nestJs on cloudfunction


We are creating an integration between https://retreaver.com/integrations and a nestjs server running on a cloud function.

What methodology is best suited for nestjs integrations authentication?

What methodology is best suited for nestjs on cloud functions authentication?

I am assuming to just use a token authentication or something simple. but I am not sure at all! ( I have no idea where to look for this authentication piece, I looked at multiple youtube videos but I have not come across anything good )

I am following the following tutorial for learning nestJs:: https://www.youtube.com/watch?v=Mgr5_r70OJQ

I looked around for similar questions but I didn't see anything close to what I was looking for. the only related question is the one below but there is no answer at the moment:: NestJS authentication: how to globally pass UserId to CRUD endpoints?

example of nestjs on cloud function :: https://www.youtube.com/watch?v=ZmfDlUAokYc

Any advise or guidance is greatly appreciated!


Solution

  • There are several ways an app can authenticate its users and restrict access to only authorized users.To learn more about the various methods to authenticate users, see the Authentication concepts section.

    In order to integrate a NestJS app to serverless cloud functions, you may create a wrapper Express function and pass it to functions-framework, check the thread for details on the same.There is also a good example describing the setup for the nest.js and cloud functions.
    I would also recommend to check the below for more information: