Facebook authentication not working for nitrous.io meteor app (node.js) - meteor

I have a meteor app running in a node.js machine on nitrous.io and the facebook authentication is not working. I created a new app in facebook, added Website as platform, set the App domain to machinename.usw1.nitrousbox.com and the Website's Site URL to http://machinename.usw1.nitrousbox.com (machinename is made up, but I have my own site there) and then I used the public & secret key to set the fb auth in running meteor app. This is all similar to how I've setup apps before, yet when I try to login to this nitrous.io app using fb, I get this from facebook:
Given URL is not allowed by the Application configuration.: One or more of
the given URLs is not allowed by the App's settings. It must match the
Website URL or Canvas URL, or the domain must be a subdomain of one of the
App's domains.
I've tried all different kinds of settings. Any ideas?

There are two ways to solve this.
Option 1:
Meteor looks for a ROOT_URL environment variable to determine the url the app is running, which is http://localhost:3000/ by default. You can keep the setting as is, but you will need to utilize the following credentials within your facebook app configuration:
site_url: http://localhost:3000/
Option 2:
If you want to utilize your preview URL then you will want to set the site_url to it within your facebook app configuration:
site_url: http://machinename.usw1-2.nitrousbox.com
The next step will be to start up Meteor with the following command:
$ ROOT_URL=http://machinename.usw1-2.nitrousbox.com meteor
Alternatively you can follow the Meteor documentation to change your root URL.

Related

Firebase Web Debug Token different each time for App Check

I can't make my app work in local host with App Check. Each time the generated debug token is different so I can't add it in the console. The only way I made it work is to add programmatically to index.html the custom debug token I generated like this:
self.FIREBASE_APPCHECK_DEBUG_TOKEN = '186152BD-4BAA-blabla';
is there a way to do this only for development environment? I know we can get the environment from Flutter inside flutter from String.getFromEnrironment but I don't know how I would do this with plain javascript before the app loads?
I read that adding localhost to the recaptcha key is a security breach so I didn't want to go that route.

how to set custom sub domain only for Dynamic links and not for Hosting?

I had a main domain example.com hosted somewhere else. I had created two subdomains of it app.example.com and link.example.com and successfully mapped these to firebase hosting. Before I deployed firebase hosting those work perfectly for dynamic links.
But after my first deployment those are not working and showing this error
https://link.example.com is not connected properly
Your Dynamic Links path prefix is not configured in firebase.json. Check your firebase.json configuration and try again.
I want my link.example.com to only work for dynamic links and app.example.com for hosting (it is for my web app). But in the Firebase web console, there is no option to set this behavior. Any one please tell me how to set one of my sub domain only for dynamic links?

ASP.Net redirecting to local host after authentication

I just created a webform that is hosted in my Azure subscription. I set it up with authenication via my works Azure directory for authenticating users. In debug this works fine and I am able to login with my work credentials and then view the website via local host.
I have published this to my Azure and it says it is running and working fine. So when I try to connect to the website it continuously redirects me to the localhost resulting in an error.
I have checked the web config.
Here is the google network chain of events when it occurs.
I am really lost as to what is wrong and what I need to do to fix this so any help would be greatly appreciated. I'm sorry I can't offer more but I don't even know what is wrong to begin with or where to look. Is there some setting in Azure that I need to add the website too?
I have solved this issue. Since it was such a pain I will keep this up as I couldn't find any answers on this. It was actually quite simple.
You have two options. The one I did and which worked was changing the publish profile as below:
Add the domain where the authentication is occurring. So if you have your web app hosted by a different azure account that which is authenticating the users, use the one that is authenticating.
This will create two versions of your app on the site one for local host and one for the actual site.
The second option(I have not tried this but it should work) is to go to the Azure account where you are authenticating the users and go to applications and then configure. Change the APP URL from local host to the url you are trying to get to.
Here is an excellent link that explains how to do this clearly.
Click this link for detailed explanation
I also had this issue and took these steps to resolve
navigate to the app registration in AAD
Open the manifest
Change the ReplyUrl to the url of the app (e.g. http://appname.azurewebsites.net)
Then I got the error
Bad Request - Request Too Long HTTP Error 400. The size of the request headers is too long.
Next I cleared all cookies from the browser, and this changed the error to just
Bad Request
So I went back to that ReplyUrl and changed it to https://appname.azurewebsites.net/.auth/login/aad/callback and now it appears to work.
Note I also had to make sure I didn't have the site open in any other tabs before it started working
I had this issue when I switched an app from our company Azure over to a customer's Azure. In my case I'd forgotten to update the ida:ClientId, ida:AADInstance and ida:TenantId, which then meant that the value I'd set for ida:PostLogoutRedirectUri was ignored (I think) and instead my app redirected to localhost.
Once I changed those ida values to the values from the app settings and subscriptions settings on our customer's Azure it all worked as expected.
It took a while to track down all the values in Azure portal as they are all called something different, or aren't named at all:
ClientId can be found at Azure Active Directory > App Registrations > YourAppName. It's called 'Application ID' in Azure
Domain can be found on Azure Active Directory > Overview. It's currently in the top left in the format somename.onmicrosoft.com
TenantId this is the Azure AD instance ID, get that from Azure Active Directory > Properties and then it's called 'Directory ID'
I spent a lot of time trying to work out where the localhost port that was being redirected to was in the code, but it simply isn't there as far as I can see, so I have no idea how Azure was choosing what localhost address to redirect to!
You need to set another parameter in configuration that is replyUrl and assign to your web app, other wise it takes the url from which it was originated.
I was able to fix this by changing my Startup.Auth.cs file redirectUri from "https://localhost:44316/" to https://myapp.com/

What will be the Firebase Authorized Domain for Firefox Packaged App?

My packaged app for Firefox OS uses Firebase and Firebase Facebook Login for user authentication. However, in Firebase I need to provide a Authorized domain for oauth redirect. What will be my Authorized domain for a Firefox OS packaged app?
I ran this app in the FF OS simulator through FF WebIDE and from there I got an app id which I used as a Aauthorized domain in Firebase and it (fb login) worked. But then I submitted my packaged app in the Firefox marketplace and got rejected as Facebook Login is not working.
What am I missing here?
I would guess it works via the simulator because you are on localhost, which is whitelisted in your account dashboard. Naturally, you aren't going to be able to create a whitelisted domain that works within the packaged app.
Instead, to make integrated auth work, you'd need to set up a hosted login page and feature that in your app, then you can whitelist the hosted page instead. For example, if you hosted your login form at yourinstance.firebaseapp.com:
Whitelist yourinstance.firebaseapp.com
App redirects to or "iframes" https://yourinstance.firebaseapp.com/login.html
When login is completed, login.html returns the userData.token to packaged app
Packaged app calls authWithCustomToken(token)
Alternately, and possibly a much simpler and more elegant solution, you could sign your own tokens and utilize those in the packaged app.

FBConnect on Drupal not working?

I installed the fbconnect module: http://drupal.org/project/fbconnect
According to some advice I got from a post on Drupal: http://drupal.org/node/1060220#comment-4088290, i Should get the latest dev version from here: https://github.com/vectoroc/fbconnect
I got the latest version, and I still have problems. When you click on the FacebookConnect icon, it tells me:
fbconnect_autoconnect_form_submit has been called without valid facebook session. Check your Application Secret on fbconnect settings page
Keep in mind:
I am running Drupal of my local machine, so my connect URL is: http://localhost/deals/src/
I DID enter the correct Application ID
I DID enter the correct Application Secret
Anybody know why I am still getting this error? Is it even possible to specify your local machine as the connect URL?
Facebook must be able to identify you by your domain name / app id / key.
So if you want fbconnect to work on your local machine, you have to configure a dyndns entry that refers to your IP and associate it with your facebook app.
This may help : http://drupal.org/node/949248

Resources