README
Firebase Device Flow
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.
- Import
FirebaseDeviceFlow
. - Initialize your Firebase app.
- Pass app reference and OAuth config object to
DeviceFlowUI
constructor. - 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".
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?