Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

API Activation
 
Notifications
Clear all

API Activation

10 Posts
2 Users
0 Reactions
8,535 Views
(@sogeti)
Posts: 135
Active Member
Topic starter
 
[#4857]

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,


 
Posted : 20 Dec 2017 13H36
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

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)


 
Posted : 21 Dec 2017 11H59
(@sogeti)
Posts: 135
Active Member
Topic starter
 

Thank you for your comeback.

It is mandatory to use the htaccess method to use the API ?


 
Posted : 21 Dec 2017 13H59
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

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).


 
Posted : 21 Dec 2017 14H23
(@sogeti)
Posts: 135
Active Member
Topic starter
 

I thank you for your information.

As Regards API key, it is used to write, update or delete ?

Thank you in advance.

Best regards,


 
Posted : 21 Dec 2017 17H51
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

As Regards API key, it is used to write, update or delete ?

Yes


 
Posted : 21 Dec 2017 17H53
(@sogeti)
Posts: 135
Active Member
Topic starter
 

I have one last question, for authentication to work with htaccess, the user must be present in the ProjeQtor database ?

Best Regards,


 
Posted : 22 Dec 2017 10H58
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

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.


 
Posted : 22 Dec 2017 11H06
(@sogeti)
Posts: 135
Active Member
Topic starter
 

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,


 
Posted : 26 Dec 2017 13H51
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Yes,
If you connect with user that has no access right on any project, it is exactly the response you will receive.


 
Posted : 26 Dec 2017 14H13
Share:

Scroll to Top