Dear community,
I am struggling to set-up a simple auth with twitter in my brand new meteor app.
I use meteor + react (but actually also tried with blaze and basic accounts-ui and it didn’t work either). I get the popup to connect to my twitter app, I enter my credentials, it validates them and then it says “redirecting you back to your apps” and then popup gets blank and does not close.
When popup is blank the redirect link in the popup is the following (I just removed part of the token for readability):
Console of the app says nothing. Console of the popup says :
end_of_popup_response.js:18 Uncaught DOMException: Blocked a frame with origin “_http://localhost:3000” from accessing a cross-origin frame.
at_http://localhost:3000/packages/oauth/end_of_popup_response.js:18:39
at_http://localhost:3000/packages/oauth/end_of_popup_response.js:37:3
In the twitter app I have my app with the following settings:
|Access level|Read and write (modify app permissions)
$|Callback URL|http://127.0.0.1:3000/_oauth/twitter?close
|Callback URL Locked|No
|Sign in with Twitter|Yes
|App-only authentication|https://api.twitter.com/oauth2/token
|Request token URL|https://api.twitter.com/oauth/request_token
|Authorize URL|https://api.twitter.com/oauth/authorize
|Access token URL|https://api.twitter.com/oauth/access_token
Of course Meteor.user() is null even after blank popup.
If I copy the link of the popup in the main browser it says Login completed, but still no Meteor.user(). Even if I copy the link and change localhost to 127.0.0.1 I get the same.
I still don’t understand where this localhost in the popup is coming from.
The only config is the following : (in server/main.js) i tried both with and without the process.env.ROOT_URL set, same result in both cases.
Meteor.startup(function() {
// process.env.ROOT_URL = "http://127.0.0.1:3000";
ServiceConfiguration.configurations.remove({
service: "twitter"
});
ServiceConfiguration.configurations.insert({
service: "twitter",
consumerKey: Meteor.settings.public.twitter.consumerKey,
secret: Meteor.settings.twitter.consumerSecret,
loginStyle: "popup"
});
I simply call Meteor.loginWithTwitter() to start the login process.
I very much need to have this work for a client but so far no success, would really appreciate help if someone has an idea. Even if no idea I’d appreciate someone creating a simple app and using accounts-twitter and accounts-ui trying to get a simple twitter auth working with meteor 1.6 and tell me if succeeded.