Electron App: How to authorize domain on Firebase - firebase

In my electron app, I have integrated the firebase google sign-in authentication method. This method is working properly in the local environment. But after packaging the application (for Linux environment), I am getting an error 'Error while login into Gmail account FirebaseError: Firebase: Error (auth/unauthorized-domain)'. When I tried to find the cause of this error, I found that we have to add the respective domain to the authorization tab but the firebase app domain is already added in settings. As you can see in the screenshot
What else do I need to add here in the domain setting?

Related

There is a problem with the server configuration. Check the server logs for more information

I used google as an auth provider with next auth. Configured all the the environment variables both in production and development. It's working perfectly in dev mode but in production it shows this error whenever i try to sign in.
I deployed the site to vercel and had setup google id, secret and NEXTAUTH_URL variables there.
I tried to setup google secret properly add it into vercel setting and google credential too
just make sure that you have setup the secret enviroment variable in nextauth i.e
secret : process.env.NEXTAUTH_SECRET

Vercel Deployment and Firebase Authentication - Unable to Customise Redirect URL Google Auth Provider Popup

I had a question in regarding to the NextJS app which uses cloud firestore and firebase authentication which is deployed using the vercel deployment and domain is also registered using vercel itself.
Deployment : Vercel
Domain : Vercel
Authentication : Firebase Authentication
Database: Cloud Firestore
Storage: Firebase Storage
I followed this document https://firebase.google.com/docs/auth/web/google-signin#expandable-4 but without firebase hosting and custom domain registration with firebase, I cannnot “Customizing the redirect domain for Google sign-inOn project creation”
Below configuration is not working
firebase config {
authDomain: “customdomain.com”
}
I cannot change the domain to firebase hosting, because then I won”t be able to deploy using vercel.
Is there a way retain my vercel deployment and customise the redirect url while authenticating user.
Firebase console> authentication > firebase console
click the settings tab
settings
then select Authorised domains and add your ustom domain, if you're unsure check the console firebase will usually tell you what domain is supposed to be added there for example mine looked like this
project-banner-eta.vercel.app
this way work for me also
Firebase console> authentication > firebase console click the settings tab
settings
then select add domains
this will pop out a domain box telling you to enter the domain name
copy your domain name and paste it there and click add
that it all. everything should be ok now

Network Error from Firebase Auth/react-native app

I have a react native mobile app using expo which I have just published to expo host in order to share with a user. The app uses Firebase auth.
Users cannot sign up, they can only sign in. The sign up is done via the app and the app creates the user in Firebase with an email, password and the emailVerified set to true. Signin is set to email/password and is not via an oath provider.
However, the user cannot then sign in on the deployed app, getting Network Error on each attempt.
Everything works fine on local host on a dev version of Firebase auth.
I also have the same setup (in prod) for a react app which is hosted from the client’s domain. The user can log in to the react app without any problems.
The expo version I’m using is 43.0.3, react-native 0.64.3, firebase 8.10.0. Sign in is via an Android tablet.
What am I missing? Any help would be much appreciated.
Mick
Hi we get the Network Error from Firebase Auth/react-native app error if you have not enabled authentication .
go to firebase console select your project
enable authentication by email/password if you are using email/password for login and signup

Running Firebase web SDK under phantomjs fails to authenticate valid tokens (auth/network-request-failed)

I am trying to use phantomJS to create a pdf of a authenticated part of a Firebase web app.
The set up is as follows
A cloudFunction is triggered when firestore is updated.
The cloudFunction creates a custom token with admin.auth().createCustomToken with the relevant claims.
A url to the hosted firebaseapp app is created, with the token as a query param.
The URL is given to phantomjs to create a pdf of the page.
When the firebase webapp boots, it grabs the token, and uses firebase.auth().signInWithCustomToken
On success it renders the page.
The hosted page works fine, and I can grab the token that the cloudFunction creates, add it to the URL and test it all in chrome with no issue.
However, when running this under phantomJS, the call to admin.auth().createCustomToken fails with
auth/network-request-failed .
A network error (such as timeout, interrupted connection or unreachable host) has occurred.
I have tried the following
Setting '--ignore-ssl-errors=yes', '--ssl-protocol=tlsv1', '--web-security=false' on PhantomJS
Setting Access-Control-Allow-Origin * on the hosting firebase.json rules
Setting a Content-Security-Policy for all the google apis on the hosting firebase.json rules
Does anyone know what would be blocking the google api within phantom?
Could it be the User agent?

Firebase: Local Development and testing in AngularFire

I am using Angularfire to make a website. I am trying to integrate oauth based sign in with google for user authentication but when I try to run index.html file and try to login following error is displayed
11:59:28.189 Error: There are no login transports available for the requested method.
Stack trace:
Mg#file:///G:/Project/root/js/firebase.js:142:1267
dh/<#file:///G:/Project/root/js/firebase.js:163:141
1 app.js:31:4
I searched on stackoverflow for this and got this answer , it says that I need to setup a server for this.
Then I looked at firebase docs and they said
For security reasons, if you're using a web-based OAuth flow
(Facebook, Twitter, Github, or Google), only domains that you
whitelist are allowed to initiate authentication for your app. This
does not apply to Email & Password, Anonymous, or Custom
authentication methods. All Firebase applications have localhost and
127.0.0.1 enabled by default for local development and testing.
The authentication works fine after I host it on firebase but deploying takes a lot of time and also sometimes even I don't have access to internet.
So please suggest me easiest manner so I can run my app on localhost.
An easy way to locally run a Firebase (or any other) web site is to use the Firebase tools and then run
firebase serve
See this blog post introducing the local server.

Resources