Skip to main content
Question

Unable to login on api V1 but ok opn api V2

  • May 30, 2023
  • 1 reply
  • 212 views

Forum|alt.badge.img+1

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

ponchoh
Centreonian
Forum|alt.badge.img+14
  • Centreonian
  • May 30, 2023

Some post that might help 

 

 

Header set Access-Control-Allow-Credentials true