kimai icon indicating copy to clipboard operation
kimai copied to clipboard

API-Authentication slow

Open acaliebe opened this issue 2 years ago • 0 comments

Describe the issue

Hi,

my onPromise installation of Kimai 2.8 on a Raspberry Pi 4b (versions see below) works as expected, but when I try to authenticate on the /api interface, there is a 1 second delay. (everytime X-AUTH-USER is valid).

This is not a problem if I only make one call. But when I try to reach more than one channel (customers/projects/activities) it is a big time issue.

For reference, browser calls to the dashboard take about 300ms to render completely. (Chrome Network Analyzer).

Thanks for this great software.

┌──(username@hostname)-[~]
└─# time curl -s -X GET 'https://hostname/api/ping' -H 'X-AUTH-USER: okusername' -H 'X-AUTH-TOKEN: oktoken' -H 'Content-Type: application/json' {"message":"pong"} real 0m1,428s 1s ✓

┌──(username@hostname)-[~] └─# time curl -s -X GET 'https://hostname/api/ping' -H 'X-AUTH-USER: okusername' -H 'X-AUTH-TOKEN: FAIL' -H 'Content-Type: application/json' {"message":"Invalid credentials"} real 0m1,353s 1s ✓

┌──(username@hostname)-[~]
└─# time curl -s -X GET 'https://hostname/api/ping' -H 'X-AUTH-USER: FAIL' -H 'X-AUTH-TOKEN: FAIL' -H 'Content-Type: application/json' {"message":"Invalid credentials"} real 0m0,151s 197ms ✓

┌──(username@hostname)-[~]
└─# time curl -s -X GET 'https://hostname/de/login' -H 'Content-Type: application/json' >/dev/null real 0m0,154s 198ms ✓

--- Server Versions: Raspbian GNU/Linux 10 ( 5.10.103-v7l+ ) mysqld Ver 10.3.39-MariaDB-0+deb10u1 for debian-linux-gnueabihf on armv7l (Raspbian 10) Redis server v=5.0.14 sha=00000000:0 malloc=jemalloc-5.1.0 bits=32 build=c885b0f14407b450 Server Version: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1n mod_fcgid/2.3.9 / MPM: prefork Composer version 2.6.6 PHP 8.2.14 (fpm-fcgi) (built: Dec 21 2023 20:21:17) - OpCache enabled

I already tried

  • [X] I've read and searched the documentation.
  • [X] I've searched for similar issues in this repository.
  • [X] I've searched for similar issues in the discussions.

Kimai version

2.8

How do you run Kimai?

Other (please mention below)

Which PHP version are you using?

8.2

Logfile

-- no Entries in Logfile --

Screenshots

No response

acaliebe avatar Jan 13 '24 20:01 acaliebe