Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:22:32+00:00 2026-06-18T06:22:32+00:00

Due to the need to do some server side code – mainly sending emails

  • 0

Due to the need to do some server side code – mainly sending emails I have decided to use Nodejs & Express for the server side element along with Firebase to hold the data – Partly from a learning experience.

My question is whats the best approach with regards to using the client side Firebase library and the Nodejs library when doing authentication using the Simple Email & Password API. If I do the authentication client side and then subsequently call a different route on the NodeJS side will the authentication for that user be carried across in the request. What would be the approach to test the user is authenticated within Node.

One approach I assume is to get the current users username & password from firebase and then post these to NodeJS and then use the firebase security API on the server to test.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:22:33+00:00Added an answer on June 18, 2026 at 6:22 am

    Essentially the problem here is you need to securely convey to your NodeJS server who the client is authenticated as to Firebase. There are several ways you could go about this, but the easiest is probably to have all of your client<->NodeJS communication go through Firebase itself.

    So instead of having the client hit a REST endpoint served by your NodeJS server, have the client write to a Firebase location that your NodeJS server is monitoring. Then you can use Firebase Security Rules to validate the data written by the client and your server can trust it.

    For example, if you wanted to make it so users could send arbitrary emails through your app (with your NodeJS server taking care of actually sending the emails), you could have a /emails_to_send location with rules something like this:

    {
      "rules": {
        "emails_to_send": {
          "$id": {
            ".write": "!data.exists() && newData.child('from').val() == auth.email",
            ".validate": "newData.hasChildren(['from', 'to', 'subject', 'body'])"
          }
        }
      }
    }
    

    Then in the client you can do:

    ref.child('emails_to_send').push({
      from: 'my_email@foo.com', 
      to: 'joe@example.com', 
      subject: 'hi', 
      body: 'Hey, how\'s it going?'
    });
    

    And in your NodeJS code you could call .auth() with your Firebase Secret (so you can read and write everything) and then do:

    ref.child('emails_to_send').on('child_added', function(emailSnap) {
      var email = emailSnap.val();
      sendEmailHelper(email.from, email.to, email.subject, email.body);
    
      // Remove it now that we've processed it.
      emailSnap.ref().remove();
    });
    

    This is going to be the easiest as well as the most correct solution. For example, if the user logs out via Firebase, they’ll no longer be able to write to Firebase so they’ll no longer be able to make your NodeJS server send emails, which is most likely the behavior you’d want. It also means if your server is temporarily down, when you start it back up, it’ll “catch up” sending emails and everything will continue to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mission critical Perl-CGI server-side application that I need to extend or
Due to a server crash I need to restore some rows, created within a
I have a pop-up div contains a table. Due to some issues, I need
due to some unavoidable reasons I need to disable Google Chrome's Chrome PDF Viewer
I have an Event class. Due to the way dates are handled, we need
I need to run my development through nginx due to some complicated subdomain routing
I actually don't know many things about server-side things (other than some PHP), but
I need some advice on a little project im doing. I have a database
Gonna need some advice for my work. In my computer I have installed VS2010
So I have my subversion repository stored on some cloud (for example code.google.com) but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.