0.1.1 • Published 3 years ago
@utagritech/firebasedeviceflow v0.1.1
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 Firebase app reference and OAuth config object to
DeviceFlowUI
constructor. If any parameters are absent from the OAuth config object, the relevant auth provider will be excluded from the UI. - 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
Build and test with the usual npm run build
, npm run test
. For testing, you will have to initialize your own Firebase app and provider support.
Requirements
- Node.js and
npm
- Dependencies (install with
npm install
)
Todo
- Convert to Typescript
- Change package structure for easier import (currently
import { DeviceFlowUI } from 'FirebaseDeviceFlow/dist/FirebaseDeviceFlow';
) - Fix testing
- 'Slow down' error code handling?
- Add more providers?