Forum

API Activation
 
Notifications
Retirer tout

API Activation

10 Posts
2 Utilisateurs
0 Reactions
8,516 Vu
(@sogeti)
Posts: 135
Active Member
Début du sujet
 
[#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,


 
Posté : 20 Déc PM 13:1212
(@babynus)
Posts: 14952
Membre 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)


 
Posté : 21 Déc AM 11:1212
(@sogeti)
Posts: 135
Active Member
Début du sujet
 

Thank you for your comeback.

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


 
Posté : 21 Déc PM 13:1212
(@babynus)
Posts: 14952
Membre 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).


 
Posté : 21 Déc PM 14:1212
(@sogeti)
Posts: 135
Active Member
Début du sujet
 

I thank you for your information.

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

Thank you in advance.

Best regards,


 
Posté : 21 Déc PM 17:1212
(@babynus)
Posts: 14952
Membre Admin
 

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

Yes


 
Posté : 21 Déc PM 17:1212
(@sogeti)
Posts: 135
Active Member
Début du sujet
 

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

Best Regards,


 
Posté : 22 Déc AM 10:1212
(@babynus)
Posts: 14952
Membre 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.


 
Posté : 22 Déc AM 11:1212
(@sogeti)
Posts: 135
Active Member
Début du sujet
 

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,


 
Posté : 26 Déc PM 13:1212
(@babynus)
Posts: 14952
Membre Admin
 

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


 
Posté : 26 Déc PM 14:1212
Share:
Retour en haut