Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I integrate firebase authentication with aws lambda

I am using Serverless framework (aws Lambda functions) but I want the authentication to be done by firebase. Is it possible to integrate this two?

like image 322
Ani Alaverdyan Avatar asked Feb 11 '18 14:02

Ani Alaverdyan


People also ask

Can Firebase be used with AWS?

With Firebase consisting of proprietary services, APIs, and an SDK, a migration to AWS requires application refactoring – introducing a new architecture using AWS services, and rewriting parts of the codebase to use them accordingly.

Is Firebase good for authentication?

Firebase Authentication provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app. It supports authentication using passwords, phone numbers, popular federated identity providers like Google, Facebook and Twitter, and more.


1 Answers

Amazon has its own authentication service integrated with AWS that's called Cognito:

  • https://aws.amazon.com/cognito/

This is usually the first choice of handling authentication, since if you're using AWS Lambda then you already have Cognito available with no additional services needed, but there is nothing to stop you from using any other authentication service like Firebase Authentication, Auth0, Stormpath, Okta etc. This may be an advantage for you if you're already using it, you have users there etc. It's marginally more complicated that Cognito (if you're using AWS) because you need to handle additional API credentials.

So the answer to your question "Can I integrate firebase authentication with aws lambda" is yes, you can. But you do it on the application level in your code, not in the AWS admin console. You do it very similarly like you would do with any traditional backend framework, like Express, Hapi, Restify etc. but using the Serverless framework.

And just like with other frameworks, it depends whether you want to do the authentication server-side or client-side.

For server-side solutions there are:

  • https://www.npmjs.com/package/@firebase/auth
  • https://www.npmjs.com/package/firebase-auth
  • https://www.npmjs.com/package/firebaseauth
  • https://www.npmjs.com/package/firebase-auth-node
  • https://www.npmjs.com/package/passport-firebase-auth

The client-side authentication is explained at:

  • https://firebase.google.com/docs/auth/web/firebaseui
like image 128
rsp Avatar answered Sep 22 '22 01:09

rsp