Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Omniauth-twitter with Rails 5 stopped working! OAuth::Unauthorized 403 Forbidden

Everything was working fine and Omniauth has stopped working suddenly. I didn't make any code changes.

I checked Twitter Apps Settings: I have callback url to my main production url, and Callback URL Locked to No. All keys are correct.

Any idea? 🤔


OAuth::Unauthorized

403 Forbidden

enter image description here

like image 313
Designer Avatar asked Jun 12 '18 22:06

Designer


4 Answers

I have been able to solve it (also for development) adding this urls:

For production:

  • https://mydomain/users/auth/twitter/callback
  • http://mydomain/users/auth/twitter/callback

For development:

  • http://localhost:3000/users/auth/twitter/callback
like image 151
antoniobg Avatar answered Nov 12 '22 22:11

antoniobg


Now on twitter callback URL, you must have to add 2 callback URLs and the callback URL must be the path of your application.

I had faced the same problem, now on adding the 2nd callback URL, it's fixed.

For more information check: https://twittercommunity.com/t/action-required-sign-in-with-twitter-users-must-whitelist-callback-urls/105342

like image 32
puneet18 Avatar answered Nov 13 '22 00:11

puneet18


Adding a second Callback URL to https://mysitecom/auth/twitter/callback fixed the issue (for now)

———-

Update: This actually solved the problem for about 10mins. Experiencing the same problem now

like image 25
Designer Avatar answered Nov 12 '22 22:11

Designer


I'm working in development not production and encountered this problem using the omniauth and omniauth-twitter gems. But with these two callback URL's:

http://127.0.0.1:3000
http://localhost:3000/auth/twitter/callback

the problem is avoided. Strange, since the RailsApps tutorial warns against using 'localhost' at Twitter.

like image 1
Scott O Avatar answered Nov 12 '22 22:11

Scott O