Accounts: How to configure the redirect URI which Meteor calls?


#1

I’d like to test a social login under real-life conditions, i.e. without using “localhost”, but instead using a domain under ngrok.io. I configured the redirect URI in Facebook, so the ngrok subdomain is accepted there. But Meteor always rells OAuth to redirect to localhost:3000, if I run my dev server locally. Is it possible to overrride this and let Meteor redirect to another domain?


#2

Have you tried setting the ROOT_URL environment variable?

ROOT_URL=someurl meteor

I’ve not tested this (no FB account), but maybe worth trying.


#3

Ah, thanks, I was looking for this option. Will try it!


#4

Unfortunately, this didn’t work. Still localhost:3000 is set as the redirect URI.


#5

:disappointed: Oh well. At least it’s added to the sum total of human knowledge.


#6

Try setting up the ROOT_URL in your client like this:

 	Meteor.startup(function () {
	  // Client startup method.
	  Meteor.absoluteUrl.defaultOptions.rootUrl = 'http://xxx.ngrok.io';
	});

This works for me, let me know how it works out for you.


#7

This works! Nice! Now if only my service was a lot faster… :wink:


#8

@t3db0t Fantastic! Now am stuck struggling to make it work with my Google Oauth more details. Any ideas are appreciated.


#9

Thank you very much:grinning: