New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

express-firebase-authenticate

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

express-firebase-authenticate

Express middleware for Firebase Cloud Functions that extracts user data from a Firebase auth token.

2.0.0
unpublished
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

github license npm version

express-firebase-authenticate

Express middleware for Firebase Cloud Functions that extracts user data from a Firebase auth token.

Details

Validates the token included using the verifyIdTokens API from the Firebase Admin SDK and attaches the decoded token to req.user. For more details on the API or decodedToken see https://firebase.google.com/docs/auth/admin/verify-id-tokens

Usage

Install module

npm install --save express-firebase-authenticate

Sample

const admin = require('firebase-admin')
const express = require('express')
const firebaseAuth = require('express-firebase-authenticate')
const functions = require('firebase-functions')

admin.initializeApp()

const app = express()

// Add middleware
app.use(firebaseAuth)

// Handle POST request to the "widgets" Firebase function
app.post('*', async (req, res) => {
  // ... your firebase function code here

  // You will have access to the decoded token at 'req.user'
  // For example...
  console.log(req.user.uid)

  res.sendStatus(200)
})

exports.widgets = functions.https.onRequest(app)

Keywords

firebase

FAQs

Package last updated on 14 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts