Hello everyone,
I'm asking you for a problem activating the ProjeQtOr API.
I am having trouble activating the htaccess file with the htpasswd file.
In my htpasswd file, I have crawled identifiers and crawled words, so everything looks normal.
At the time of verification of the activation, I connect via the address http://*server*/api , I enter an identifier present in the file htpasswd and the password but I am rejected.
I manage to communicate with the API by overriding the validation of the htaccess file.
I do not see what blocks in my htaccess file, it is standard, nothing has been changed in this one.
My htaccess file :
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?uri=$1
AuthUserFile "/Applications/MAMP/htdocs/api/.htpasswd"
AuthName "projeqtor"
AuthType Basic
require valid-user
Thanks in advance,
Best Regards,
I think issue is on the .htpassword.
For instance, this file requires crypoted password.
You must use a tool to generate wontent of .htppassword, and most web tools will give wrong data (I gues it will depend on your system, apache version or else).
Best is to use the htpasswd command on linud (worked fine for me)
Thank you for your comeback.
It is mandatory to use the htaccess method to use the API ?
If is not mandatory to have API work.
It is mandatory to set some security in API usage.
Take care that API can read and update all your Data.
So non secured access may be a leak access to your data.
If you run ProjeQtOr without internet access (only opened on your local network) and you trust your team, then you may disable htaccess (but this is not advised).
I thank you for your information.
As Regards API key, it is used to write, update or delete ?
Thank you in advance.
Best regards,
As Regards API key, it is used to write, update or delete ?
Yes
I have one last question, for authentication to work with htaccess, the user must be present in the ProjeQtor database ?
Best Regards,
Yes, of course.
And API will retreive acces rights of this user.
This means you can give access as readonly and only to data of some projects.
Hello,
After the authentication, the web page sends me this
{"identifier":"id", "items":[] }
the link of the web page is : " https://serveur/api/project/all "
Is this a problem of the right of the user?
Best Regards,
Yes,
If you connect with user that has no access right on any project, it is exactly the response you will receive.