I created an app in twitter and trying to do basic authentication but I am getting the below error so can anyone help me with this? How to resolve the error?

Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings

2

There are 2 answers

9
Andrea Nagy On

If you do receive this error message, please check the URL that you are using with the callback_url parameter in your oauth/request_token call and make sure that this URL has been whitelisted in your Twitter app settings in the developer portal.

Here is a description on how to solve your issue: https://developer.twitter.com/en/docs/basics/developer-portal/guides/callback-urls.html

1
jarosik On

I've been struggling with callback_url and Spring Social for some time.

Add following url to Twitter whitelisted. For localhost use:

https://localhost/auth/twitter

for deployed app:

https://example.com/auth/twitter or https://IP.ADR.ESS/auth/twitter

First make sure it works on localhost, meaning your machine. If it works on localhost but fails afted deploy on specific IP, the problem is most probably with your server IP. Spring Social Twitter creats this urlcallback based on some host parameters. If you deploy on a machine that is behind a proxy, a real callack url may be different than IP addres the app is running on. That was my case. I had two VPS from different vendors. Same config worked on first, failed on second.