4
votes

I am using the omniauth-facebook, omniauth-twitter, omniauth-google-oauth2 gems
for signing in, on localhost everything works fine, but in production it adds the port number 5050 to the authorization url, has anybody encountered this problem? My site url is addthis.com

Twitter url

http://addthis.com:5050/users/auth/twitter/callback?oauth_token=krnYyA5BzM4JlCc5XVxuhsdfspArsdfgtkrUzajMts&oauth_verifier=MjLR9fPSV7aWThOe80oDuPBpB6pvVdBijKMMLdxifR4

Facebook url:

https://www.facebook.com/dialog/oauth?client_id=213027215529249&redirect_uri=http%3A%2F%2Faddthis.com%3A5050%2Fusers%2Fauth%2Ffacebook%2Fcallback&response_type=code&scope=email&state=1bf3f21df9be97337asdfasdfsda4995bdf9982f321d

Google url

The redirect URI in the request: http://addthis.com:5050/users/auth/google_oauth2/callback did not match a registered redirect URI

1
I just tried logging in on your website with Twitter and it worked. I would also suggest that however weird, the error is rather in your code than the gem - it's widely used and properly tested.Mike Szyndel
I didnt want to publicize my real site url, so I changed the url, my website is not in english. www.socpost.net is my siteAydar Omurbekov
I don't really remember how Twitter oauth works, but My bet is that you set at some point redirect URL with :5050. When I try to log in with Twitter it doesn't send redirect_url in params TO Twitter, so I belive it is preset in Twitter configuration before. Same for Google. Go to oauth settings and fix them!Mike Szyndel
I am sure I configured everything correctly in oauth settings, I did not add :5050 port, on localhost everything works fineAydar Omurbekov
So what is the value in Callback URL in your app? (apps.twitter.com, click name, go to Settings)Mike Szyndel

1 Answers