View Issue Details

IDProjectCategoryView StatusLast Update
0026365mantisbtapi restpublic2023-05-25 15:03
Reporterpolzin Assigned Todregad  
PrioritynormalSeveritymajorReproducibilityhave not tried
Status closedResolutionno change required 
Product Version2.22.1 
Summary0026365: Fix a possible installation issue for the mantis rest api
Description

On trying out the rest api, all requests were answered with "401 API token required", although the Authorization token was transmitted.
Adding the line

SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0

in $MANTISROOT/api/rest/.htaccess, as suggested by https://www.cyotek.com/blog/restoring-missing-authorization-header-when-using-php, fixed the issue.

Additional Information
diff --git a/api/rest/.htaccess b/api/rest/.htaccess
index 6b27d11..7b3007e 100644
--- a/api/rest/.htaccess
+++ b/api/rest/.htaccess
@@ -1,4 +1,5 @@
 # Based on Slim Framework recommendation @ http://docs.slimframework.com/routing/rewrite/
+SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
 RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^ index.php [QSA,L]
TagsNo tags attached.

Activities

dregad

dregad

2023-05-05 09:14

developer   ~0067739

Could you please check if adding CGIPassAuth On [1] to your .htaccess or conf file instead of the SetEnvIf directive fixes the problem ?

dregad

dregad

2023-05-15 04:34

developer   ~0067750

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.