Open bernah4 opened 5 years ago
As @kermith72 explain in other ticket you need to escape the \ or to protect it.
Hi @lpinsivy I think this answer is highly misleading.
I myself was bitten by this recently: Centreon actually returns (purposedly ?) a forward-slash-escaped token !
You might have to unescape it especially in scripted scenarii.
For example, with the login response {"authToken":"9nUR96sbqO1hUZ2Pc9TCozODRUHleK57\/AsZQEDgoMg="}
...
Trying with raw/escaped/protected token:
$ curl .... \
-H 'centreon-auth-token: 9nUR96sbqO1hUZ2Pc9TCozODRUHleK57\/AsZQEDgoMg='
"Forbidden"
Meanwhile with unescaped forward slash:
$ curl ... \
-H 'centreon-auth-token: 9nUR96sbqO1hUZ2Pc9TCozODRUHleK57/AsZQEDgoMg='
{"results":[{"code":202,"message":"The status send to the engine"}]}
As far as good-taste and interop. goes, I thinks Centreon should not return escaped token and should let the user handle this if needed :-)
Regards,
Alexis
Hi im making script using the centreon api and i have the same isue as #7616. i'm getting for example this token \:
T\/n4k2\/ZkFkiCwgadp1lJG2csrD\/BhnfJjKUDsz4u5g=
when i try the solution of the mentioned post this is what i get \:
As we can see backslash are treats like escaped char, so it's seems like the token is interpolate and should not be.