I\'m trying to use Firebase with Electron. When installing it just like I would on a web page it doesn\'t work because Electron pages are hosted locally and don\'t have a
You can use firebase auth's GitHub, Twitter, Facebook, Google Provider with electron by using the manual sign in flow and firebase auth signInWithCredential method.
https://firebase.google.com/docs/auth/web/github-auth#handle_the_sign-in_flow_manually
I created useful library for these case.
https://github.com/mironal/electron-oauth-helper#firebase-auth-integration
// Github manually flow example.
const { OAuth2Provider } = require("electron-oauth-helper")
const config = { /* oauth config. please see example/main/config.example.js. */}
const provider = new OAuth2Provider(config)
provider.perform()
.then(resp => {
const query = querystring.parse(resp)
const credential = firebase.auth.GithubAuthProvider.credential(query.access_token)
firebase.auth().signInWithCredential(credential)
.then(user => {
console.log(user)
})
.catch(error => console.error(error))
})
.catch(error => console.error(error))