Forum

[SOLVED] User exist...
 
Notifications
Clear all

[SOLVED] User exists but is unknown

3 Posts
2 Users
0 Reactions
1,587 Views
(@nedel)
Posts: 2
New Member
Topic starter
 
[#7639]

Hello,
I have been trying to use the api for some time, but I cant' get past this error:

{"error":"invalid API query", "message":""user 'projeqtor' unknown in database""}

The php file used to make the request:


The .htaccess file located in WEBROOT/projeqtor/api/ :


  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?uri=$1


Here's an extract from projeqtor parameters.php file:
<?php
$paramDbType='mysql';
$paramDbHost='127.0.0.1';
$paramDbPort='3306';
$paramDbUser='projeqtor';
$paramDbPassword='PASSWORD';
$paramDbName='projeqtor';

AuthUserFile WEBROOT/projeqtor/api/.htpasswd
AuthName "ProjeQtOr"
AuthType Basic
Require user projeqtor

So far I have checked:
- that the .htaccess file is correctly used by apache
- that projeqtor exists as a user in mariadb and has all required privileges on the database
- that the database was up and running
- that the modules auth_basic and rewrite were installed and enabled
- that the .htpasswd was where it needed to be with the right infos in it (generated via htpasswd command)

I am running out of ideas and would really appreciate if someone could figure out what is wrong.


 
Posted : 21 Jul 2021 14H29
(@babynus)
Posts: 14952
Member Admin
 

User must exist in .htPassword, but must also exist in ProjeQtOr.
You will use the API key for this user, and API will have the rights defined for this user, so that you can control what the API call will be able to do (and not to do)


 
Posted : 22 Jul 2021 13H28
(@nedel)
Posts: 2
New Member
Topic starter
 

Thanks a lot, I though for sure that the message was referring to the user accessing the database and it didn't occur to me that there had to be an actual application user to access the api.


 
Posted : 22 Jul 2021 13H39
Share:

Scroll to Top