We're using the Basic_Auth plugin, so users are automatically logged in via the Apache authentication.
Mantis 2.25.6
PHP 7.4
Apache 2.4
To use the REST API, however , would require passing both the HTTP auth and the Mantis token
for example
issue_id=1234
curl --header "Authorization: $token" \
--user $user:$pwd \
http://server/mantis/api/rest/issues/$issue_id
but Apache doesn't like mixing --user with the Authorization header.
I tried removing the authentication requirement for the path /mantis/api/rest
but I still get 401 errors.
Is there some Mantis or Apache setup to make this work?
REST api with Basic_Auth plugin
Moderators: Developer, Contributor
-
- Posts: 4
- Joined: 28 Nov 2016, 00:14
Re: REST api with Basic_Auth plugin
I created this file:
However, when I call the REST API, the call fails because it tries to get the user in the Basic_Auth plugin:
with contents:DOCROOT/mantis/api/.htaccess
This allows me to navigate to the URL https://server/mantis/api without requiring HTTP authentication. So far so good!Require all granted
However, when I call the REST API, the call fails because it tries to get the user in the Basic_Auth plugin:
Is there a way for the plugin to detect that it is being called via the REST api, and set the user some other way?<b>Notice</b>: Undefined index: REMOTE_USER in <b>/mantis/plugins/BasicAuth/BasicAuth.php</b> on line <b>39</b><br />