Nitrous meteor - cannot get loginWithFacebook to work

UPDATE:. When I deploy the application to meteor.com, I do not get any of the problems, so the problem is definitely related to the development environment, and I suspect that some actions are related to ROOT_URL and how redirects are handled.


I am running Meteor on Nitrous.io .

I installed the account-facebook package and added the following to the server folder:

ServiceConfiguration.configurations.remove({ service: "facebook" }); ServiceConfiguration.configurations.insert({ service: "facebook", appId: '31058319242*****', secret: '4f6c8a9b5aab235111e97*********', site_url: 'http://accounts-*****.apse2.nitrousbox.com/' }); 

I also changed the root URL of my application on startup:

 Meteor.startup(function () { Meteor.absoluteUrl.defaultOptions.rootUrl = "http://accounts-*****.apse2.nitrousbox.com/" }); 

I included the same URL in my Basic application settings:

enter image description here

and "Advanced":

enter image description here

[obviously ***** is actually a string identifying the Nitrous Oxide field - I edited it here)

However, when I try to authorize the use of facebook, I get the following error:

 Exception while invoking method 'login' Error: Failed to complete OAuth handshake with Facebook. failed [400] { "error": { "message":"Invalid redirect_uri: Given URL is not allowed by the Application configuration.", "type":"OAuthException", "code":191 } } 

I tried several different options for these settings, but to no avail.

Anyone else run into this issue? Help evaluate.

+6
source share
2 answers

The problem is that ROOT_URL is not set in the URL field. You will notice that the terminal output still says => App running at: http://localhost:3000/ when you start the application using the meteor command.

Meteor.absoluteUrl is just a utility function ( https://github.com/meteor/meteor/issues/858 ). When you start the application, you need to override the ROOT_URL environment ROOT_URL .

Try starting the application using ROOT_URL=http://accounts-*****.apse2.nitrousbox.com/ meteor . Then the Facebook authentication process should work correctly.

+10
source

laktek answer above is correct. I am adding this image to illustrate how a solution is achieved, because it was not immediately obvious to me.

Omit the function Meteor.absoluteUrl and instead run the meteor inside the nitrogen console as follows:

enter image description here

+1
source

All Articles