Question

Unable to login on api V1 but ok opn api V2

  • 30 May 2023
  • 1 reply
  • 132 views

Badge

Hello,

When I try to login in api V2 : it’s ok

curl --location --request POST 'https://nagios.mydomain/centreon/api/latest/login' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"security": {
"credentials": {
"login": "ecran-api-v1",
"password": "XXXXXXX"
}
}
}'
{"contact":{"id":61,"name":"ecran-api-v1","alias":"ecran-api-v1","email...

But the same user on api V1 doesn’t log in:

curl -s -k -d "username=ecran-api-v1&password=XXXXXXX" -H "Content-Type: application/x-www-form-urlencoded" -X POST "https://nagios.mydomain/centreon/api/index.php?action=authenticate"
"Authentication failed"%

Is there a magic option “allow api v1” or anything else I’ve missed ?


1 reply

Userlevel 4
Badge +13

Some post that might help 

 

 

Header set Access-Control-Allow-Credentials true

Reply