Forum

Thread tagged as: Error, Twitter

Twitter App authentication error

Hi

I am getting the following error when configuring Twitter app settings on a new installation. As a result any schedules fail to trigger.

I've added the client's URL to the Callback URL whitelist in Twitter App's settings.

There was an error: Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings

I've noticed that Twitter has the following in their docs:

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.

I wonder if the request from Perch is not including this newly-required callback URL in the parameter when trying to auth with Twitter?

Thanks in advance,

Jon

Perch Runway: 3.1.3, PHP: 7.2.13, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 38fea24f2847fa7519001be390c98ae0acafe387 $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.1.3), assets (3.1.3), categories (3.1.3), jaygeorge_perch_admin_style (1), perch_blog (5.6.1), perch_twitter (4.0)
App runtimes: <?php $apps_list = [ 'perch_blog', 'perch_twitter' ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /homepages/33/d220831601/htdocs/wibexpo/perch
PERCH_CORE: /homepages/33/d220831601/htdocs/wibexpo/perch/core
PERCH_RESFILEPATH: /homepages/33/d220831601/htdocs/wibexpo/perch/resources
Image manipulation: GD
PHP limits: Max upload 64M, Max POST 64M, Memory: -9.5367431640625E-7M, Total max file upload: -9.5367431640625E-7M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
HTTP_HOST: www.wibexpo.co.uk
DOCUMENT_ROOT: /kunden/homepages/33/d220831601/htdocs/wibexpo
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Jonathan Elliman

Jonathan Elliman 27 points

  • 2 years ago

Update and temporary fix:

I found that hardcoding the actual callback url set in Twitter app settings and using that as a replacement for tmhUtilities::php_self() in the app, means that Twitter allows the app to authenticate with the API. So something isn't right with the URL that the tmh function utility is generating:

So echoing out the URL into the settings page I get https://DOMAIN/perch/addons/apps/perch_twitter/settings/.

But the site is setup to default to www prefix so the tmh utility function is stripping the www off the URL for some reason.

If I now add this specific URL to the Callback URL in Twitter it all works again. If I don't enter the full URL then the callback function fails once again.

Hi I can confirm this is a bug, you have to add /[YOUR PERCH FOLDER NAME]/addons/apps/perch_twitter/settings/ to your callback URL on the Twitter App Settings to fix as you suggest