@openformtech/firebasedeviceflow

Firebase authentication via OAuth2 'Device Flow' for Node.js CLI applications on limited input devices (i.e. IoT).

Usage no npm install needed!

<script type="module">
  import openformtechFirebasedeviceflow from 'https://cdn.skypack.dev/@openformtech/firebasedeviceflow';
</script>

README

Firebase Device Flow

forthebadge forthebadge forthebadge forthebadge forthebadge

Firebase authentication via OAuth2 'Device Flow' for Node.js CLI applications on limited input devices (i.e. IoT).

Providers Currently Implemented

Example Usage

See test.ts.

  1. Import FirebaseDeviceFlow.
  2. Initialize your Firebase app.
  3. Pass app reference and OAuth config object to DeviceFlowUI constructor.
  4. Execute DeviceFlowUI.signIn(). This will return a Promise<UserCredential>.

How It Works

Google has a great resource on "OAuth 2.0 for TV and Limited-Input Device Applications".

Device Flow Diagram

Development

Requirements

  • Node.js and npm
  • Install JS dependencies with npm i
  • Compile with tsc --build

Todo

  • Convert to Typescript
  • Change package structure for easier import (currently import { DeviceFlowUI } from 'FirebaseDeviceFlow/dist/FirebaseDeviceFlow';)
  • 'Slow down' error code handling?
  • Add more providers?

firebase