View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0026365 | mantisbt | api rest | public | 2019-11-18 09:45 | 2025-05-29 05:42 |
Reporter | polzin | Assigned To | dregad | ||
Priority | normal | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Product Version | 2.22.1 | ||||
Target Version | 2.25.8 | Fixed in Version | 2.25.8 | ||
Summary | 0026365: Missing Authorization header in REST API causing requests to fail | ||||
Description | On trying out the rest api, all requests were answered with "401 API token required", although the Authorization token was transmitted.
in $MANTISROOT/api/rest/.htaccess, as suggested by https://devblog.cyotek.com/post/restoring-missing-authorization-header-when-using-php, fixed the issue. EDIT (dregad): fixed URL to blog article; markdown formatting. | ||||
Additional Information |
| ||||
Tags | No tags attached. | ||||
Could you please check if adding |
|
polzin, You did not provide any feedback; I am therefore resolving this issue as "no change required". Feel free to reopen the issue at a later time and provide the requested information. |
|
Sorry for the delay.
vs. |
|
Thanks for the feedback, I'll fix this in the next hotfix release. |
|
Hello, Firstly, thanks for posting a notification on the original block article. I didn't think this was a bug with MantisBT itself so I never reported it here unlike some of the other issues I raised at the time. I tested this new way, but it didn't work for me - the logs showed
PHP version: 8.2.7 running under Plesk (Obsidian?) as a "Dedicated FPM application served by Apache" (I also tried ...served by nginx, same error) Apparently Regardless though, I guess it is an environment problem as opposed to something with MantisBT, but thought I'd follow up anyway. Regards; |
|
You're welcome. It thought it would be a good idea since this Issue's OP came here after applying your workaround.
Probably unrelated, but please note that we don't support PHP 8.2 (yet).
Have you tried Keep us posted |
|
I noticed in error logs alers. [Mon Aug 28 23:59:53.777128 2023] [core:alert] [pid 22624:tid 140187749291776] [client XXX:49002] /opt/httpd/XXX/html/mantis/api/rest/.htaccess: CGIPassAuth not allowed here Still the access works. That makes no sense. For me, I will fall back to the other solution. |
|
Weird. According to Apache documentation, CGIPassAuth Directive is allowed in .htaccess context.
If you can spare the time and effort, this may be worth reporting to Apache. |
|
I rechecked and found out: On other webservers, CGIPassAuth is forbidden in .htaccess, and thus only the other directive is allowed and required. So it seems to me, it´s a configuration issue and not an Apache issue. |
|
MantisBT: master-2.25 edfc6d6c 2023-06-06 11:11 Details Diff |
REST API .htaccess pass on Authorization headers Avoids requests failing with HTTP 401 error caused by missing Authorization header. Fixes 0026365 |
Affected Issues 0026365 |
|
mod - api/rest/.htaccess | Diff File | ||
MantisBT: master 97aa8e50 2025-05-09 03:55 Details Diff |
Bump Apache minimum requirement to 2.4.13 - 2.2 is EOL since 2018. - 2.4.13 is required for CGIPassAuth (see issue 0026365) |
Affected Issues 0026365 |
|
mod - docbook/Admin_Guide/en-US/Installation.xml | Diff File |