-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
403 Forbidden on /users/auth/twitter #131
Comments
Same here. I just created a new Rails 5 project 5 (2.5.0 ruby) using Devise and omniauth-twitter and I am still getting 403 Forbidden in the request phase. I added httplog gem to see some basic tracing in the rails app. I then set the client_options.site parameter available in omniauth-twitter to point the oauth calls to a simple python server, to trace out the initial POST request headers. Here are the results:
So I can see/confirm that my callback url is: Of course, I've added the following urls to app settings: http://localhost:3000/ And still the 403 forbidden error - the same problem we have on our production site. It seems the Twitter side just won't accept the request even with the URLs defined. It doesn't seem like an issue with omniauth-twitter. I've posted again to the twitter developers forum in the hope that somebody can take a look. |
It looks like it has to do with this: https://twittercommunity.com/t/action-required-sign-in-with-twitter-users-must-whitelist-callback-urls/105342 In Twitter app settings, I had to add both |
Had the same issue, adding the callback URLs as mentioned geordanr fixed it on development, but not on production. Someone told me to add these lines to my nginx
|
@0x263b we're still seeing this issue in production mode. However, we're running in heroku. Trying to determine if we're suffering from your issue or if it's something like Twitter has a delay after adding the callback before it starts allowing it |
Same here @jwg2s I have this same problem as well. I added my original auth URL as well as my callback URL and so far no joy. |
@jwg2s What we found is that it was working this morning.. we edited the callback URLs to add a new one, and then nothing worked anymore.. Been about 3 hours of far. |
To add to this, trying all our keys, result in exactly the same problem. No love. Hard to pinpoint if it's an OmniAuth problem or a Twitter problem.. but, either way, OAuth with Twitter 100% doesn't work right now for us. This also includes regenerating keys (to see if they had expired the keys but this wasn't shown in the UI). That didn't change anything either. |
Ours did eventually start working yesterday @wflanagan. We added the following callbacks:
Definitely worth checking your URLs for typos, trailing slashes, etc Ultimately, I think it's safe to close this ticket as it's not a problem with the gem, but rather rules that Twitter changed on their end. Maybe add to the Readme and close? |
Ugh. Ok.. i'll try that. |
So, that doesn't seem to be my problem, unless there's something being added to the callback URLs. |
Following up on my issue: Our problem was caused by using the wrong consumer/secret key being used. We had been using our Twitter account's consumer/secret and not our app consumer/secret. Historically, this actually worked and allowed us to authenticate with OAuth, which is why it probably never got picked up or noticed until the recent whitelisting changes at Twitter, which then stopped our app from working - with us initially thinking it was a callback/whitelisting issue! Many hours later of searching for a callback/whitelisting problem it was actually just the wrong keys. I ended up monkey patching the OAuth gem to see what the requests and headers were. So from my side there is no issue with this gem it was our config that was wrong. I agree with @jwg2s that we can probably close this issue. |
@richhollis you are the real deal man. I also had our twitter application key and secret used in our omniauth config. Thanks for saving me hours :). |
@posixpascal glad to hear it saved you the hours that I lost :) One thing I've subsequently found: any long-lived access tokens you have issued against the old keys will still need to be paired with the original keys that they were issued against, when using the Twitter API, otherwise you'll get an Unauthorized error. So depending on if the user has since logged in with the newer app key, I will use the newer app key or the previous account app keys with their long-lived access token. |
Landed here from Google, figured I'd share what ended up working for me in case it helps someone else. In my case, I had the callback URLs set to use SSL (https), but had not enabled |
devise.rb
user.rb
Still getting a 403 on
users/auth/twitter
, usingomniauth-twitter
with Devise.I've set up the callback_url on the Twitter apps dashboard, no change
The text was updated successfully, but these errors were encountered: