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?
-
2Can you describe a bit what type of authentication you are thinking of here? – Frank van Puffelen Feb 11 '18 at 15:03
-
https://stackoverflow.com/questions/37325775/amazon-lambda-to-firebase ? :D – Lech Migdal Feb 12 '18 at 07:31
1 Answers
Amazon has its own authentication service integrated with AWS that's called 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:

- 107,747
- 29
- 201
- 177
-
8
-
1
-
@SomeoneSpecial It's complicated when compared to Firebase. Firebase's auth is one of its big selling points. – MSOACC Mar 22 '21 at 22:42
-
thank you, it has been close to a year and I've been using firebase. The only complain is the slight lag time for the authstate to transit, about 300-500ms. – Someone Special Mar 23 '21 at 09:17