Hello Wazuh Team,
I have an angular web application that access wazuh API Rest to get agent inventory information (name, ip, cpu, etc..), I am getting information from some endpoints (/syscollector/<id>/hardware) without problems, but in a particular endpoint (GET /agents) I have a CORS ERROR, configuration it`s the same, I am authenticated succesfuly, and get the Bearer token succesfuly, I have access succesfuly with postman and curl command, but from my app don´t work. I atach the error and other screenshot with a succesfuly get.
wazuh api.log
good request from angular app:
2023/08/16 23:58:43 INFO: unknown_user 192.168.200.101 "OPTIONS /security/user/authenticate" with parameters {} and body {} done in 0.003s: 200
2023/08/16 23:58:44 INFO: userapi 192.168.200.101 "POST /security/user/authenticate" with parameters {} and body {"username": "userapi", "password": "****"} done in 1.181s: 200
2023/08/16 23:58:44 INFO: unknown_user 192.168.200.101 "OPTIONS /syscollector/001/hardware" with parameters {} and body {} done in 0.003s: 200
2023/08/16 23:58:45 INFO: userapi 192.168.200.101 "GET /syscollector/001/hardware" with parameters {} and body {} done in 0.473s: 200
no good request from my angular app:
2023/08/17 00:03:44 INFO: userapi 192.168.200.101 "POST /security/user/authenticate" with parameters {} and body {"username": "userapi", "password": "****"} done in 0.723s: 200
2023/08/17 00:03:44 INFO: unknown_user 192.168.200.101 "OPTIONS /agents" with parameters {} and body {} done in 0.002s: 403
good request from postman:
2023/08/17 00:05:37 INFO: userapi 192.168.200.101 "POST /security/user/authenticate" with parameters {} and body {} done in 0.306s: 200
2023/08/17 00:06:25 INFO: userapi 192.168.200.101 "GET /agents" with parameters {} and body {} done in 0.086s: 200
I would appreciate your help.
Thanks,