I have a firebase project set up where I am only using the firebase auth features. I have a react app that uses the firebase client-side javascript SDK for authentication and a custom backend + database that does not use any firebase features.
Currently when users are logging in with a popup flow, they see the auth domain "myappname.firebaseapp.com" as per the default firebase config. It all works great.
However, if I now want to set up a custom auth domain, what I've gathered from other answers is that I need to:
Add an authorized redirect URI in firebase console to point to my custom auth domain, say https://auth.myappname.com/__/auth/handler
Change authDomain in my client side code (firebaseConfig object) to my custom auth domain.
Is there anything else I need to do for this to work? How this can work out of the box without me having to write some custom redirect logic? If my react app is being served via static hosting like an S3 bucket, then I won't even have a server running. How is https://auth.myappname.com/__/auth/handler handling anything?
Much of the documentation online is talking about using firebase hosting or other firebase black magic which I do not want to use.
Any explanations appreciated..
Related
Is it possible to change the auth handler url that will be shown when using Authentication methods of Firebase?
Say, from myapp.firebaseapp.com//auth/handler to mydomain.com//auth/handler.
The Auth domain needs to be a Firebase Hosting custom domain -- so you'd need to move mydomain.com to Firebase Hosting or create a new subdomain e.g. auth.mydomain.com that is connected to Firebase Hosting.
Once you've done that, you should add the domain as an authorized domain for Firebase Auth (as well as for any of your external OAuth provider configurations) and set the domain as authDomain in your initializeApp(...) call.
We are working on an application that uses firebase for authentication purposes. We implemented the authentication mechanism in our angular application and everything works fine. what we want now is to add custom claims to the JWT tokens generated once the user is authenticated. We know about the Admin SDK here:
https://firebase.google.com/docs/auth/admin/custom-claims
but this requires the addition of a web service. is there a way to configure firebase via the portal to add a default custom claim for all existing users and new users. what we want is to add an "id" field with random GUID. is it possible to use the Admin SDK to configure this behaviour once and for all?
Thanks in advance.
There is no way to add custom claims without using the Admin SDK. This requires that you run a script on a trusted environment, such as your development machine, a server you control, or Cloud Functions for Firebase. The latter is probably your best option if you want to do this regularly, and don't have your own server.
I have a web app developed using Firebase. It is hosted by Firebase and my domain is connected to it. It uses Google as an identity provider for authentication. However, when signing-in via a popup, the Google 'OAuth consent screen' provides a link direct to the Firebase project.
Is there a way to make the link point to the associated web site?
Turns out there is an easy solution for my scenario. Just needed to set the authDomain parameter of config passed to the firebase.initializeApp() method to my domain (rather than the default <project-name>.firebaseapp.com value). Initially this will cause the OAuth screen to throw an error but it includes a link to a configuration page where I needed to add https://<my-domain>/_auth/handler to the list of authorization handlers.
As i am new to react native stuck at one point.
I am developing an app in which i am using wordpress as a backend to store the new users data.
To Create a new user i need authentication as i am using wp rest api plugin to create user.
For authentication i have used Oauth Server plugin in wordpress admin.
Now issue is as per the Oauth documentation i need to get the authentication code in my app.
So want to know how to redirect_uri to our react-native app so that i can get authorization code in app?
To get authorization code in react-native app, You need to set the custom Url scheme.
twitter has well documented guide to create it.
https://dev.twitter.com/cards/mobile/url-schemes
After creating the Url scheme. You need to set the redirect_uri as explained here in wp-oauth server's docs Step 2 and replace the created custom url of your app in redirect_uri.
This will redirect you to your app when oauth server's callback with the access token that you can use in your react-native application.
I have an app buit with Firebase I want to deploy using Trigger.io.
In the App I'm using the auth.login('twitter') function.
What domain name shall I put in the Auth setting of my app?
Thanks a lot !
Following up on this thread in case anyone else is looking for the answer to this.
The OAuth-based authentication providers in Firebase Simple Login use pop-ups (via window.open(...) to initiate login flows, and window.postMessage to safely communicate between the two frames.
In order to enable these social, OAuth-based providers in Firebase Simple Login in the Trigger.io environment, there are a few steps:
Ensure you're loading the latest Firebase Simple Login client from the Firebase CDN, at https://cdn.firebase.com/v0/firebase-simple-login.js.
The Trigger.io environment support does not require an authorized domain configuration in Forge, but still will require that you configure your Facebook / Twitter / GitHub application to use the appropriate https://auth.firebase.com/auth/... redirect URL, as documented.
Ensure that any required Trigger.io JavaScript libraries are included (the forge global variable should be set in your application - test with console.log(forge) in your client code).
Lastly, and most important, the Trigger.io Tabs Module must be enabled in your application config.