?
avatar chetanmadaan
chetanmadaan
29 Jun 2020

Steps to reproduce the issue

Install Joomla 4 Beta 1.
Try to authentication using Bearer Token Header using postman or the tool of your choice on /api/index.php/v1/content/article

Expected result

Should work and display articles JSON (however, this is valid on all API's)

Actual result

You'll see 403 error in return

System information (as much as possible)

PHP 7.3.0
apache2handler
(php-fpm(FastCGI) is disabled)
Joomla 4.1 Beta

Additional comments

Adding the below code to .htaccess file fixes the issue.

RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]

https://github.com/joomla/joomla-cms/blob/4.0-dev/plugins/api-authentication/token/token.php#L91
I have tried a print_r of both $_SERVER and apache_request_headers() and both appear to NOT have the Authorization header.

This is a default cPanel/WHM with EasyApache 4 setup.

avatar chetanmadaan chetanmadaan - open - 29 Jun 2020
avatar joomla-cms-bot joomla-cms-bot - change - 29 Jun 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 Jun 2020
avatar chetanmadaan chetanmadaan - change - 29 Jun 2020
Title
J4 - Token Authentication does not work on cPanel/WHM running PHP 7.3.0 with apache2handler
[4.0] - Token Authentication does not work on cPanel/WHM running PHP 7.3.0 with apache2handler
avatar chetanmadaan chetanmadaan - edited - 29 Jun 2020
avatar PhilETaylor
PhilETaylor - comment - 30 Jun 2020

Try recently released Joomla 4.0.0 Beta 2 released today which has a new htaccess.txt with the changes from #29303

avatar chetanmadaan chetanmadaan - change - 30 Jun 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-06-30 19:48:03
Closed_By chetanmadaan
avatar chetanmadaan chetanmadaan - close - 30 Jun 2020
avatar chetanmadaan
chetanmadaan - comment - 30 Jun 2020

Got it. so the Hack/fix is really having that line as part of .htaccess. I guess that does it.

Thank You Phil.

avatar PhilETaylor
PhilETaylor - comment - 30 Jun 2020

I have not tested the changes - but knowing Nic who developed them, he would have tested it on multiple platforms and it has changed since your beta 1 code test - give it a go and report back if the new htaccess fixes your specific issue :-)

Add a Comment

Login with GitHub to post a comment