Shubham Singh
Shubham Singh

Reputation: 207

Allow only valid firebase user to access my Nodejs API

I have an android app and using firebase for authentication and other purposes, its working fine but for one service we are setting up the NodeJS backend. The NodeJS Rest API will be called from the Android app, so we want to validate that each API request is coming from my genuine Firebase user, I mean user will send a token(like JWT or other) with each API request ,and we can fetch the data from firebase using that token and validate it is a genuine request.

So please suggest is it possible?

Upvotes: 0

Views: 152

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598740

The Firebase documentation has a section on verifying ID tokens using the Node.js Admin SDK. After verifying the token, you'll want to check in your Node.js code whether the user is authorized to access the data they're requesting.

Upvotes: 1

Related Questions