Bonita API autentication for create messages not working

1
0
-1

Hello~ I'm developing an flow for register menbers and have to wait the flow while the user save the data in other backend application~

Then I'm using "Catch message" task for wait the message and my backend notify using the processInstanceId as Correlation (in the future, now no for testing/development).

Then I'm creating the next curl as testing and response Status 204 (OK - Not content):

curl -c cookies.txt -X POST http://localhost:27373/bonita/loginservice -d 'username=walter.bates&password=bpm&redirect=false' -vNote: Unnecessary use of -X or --request, POST is already inferred.
* processing: http://localhost:27373/bonita/loginservice
* Trying [::1]:27373...
* Connected to localhost (::1) port 27373
> POST /bonita/loginservice HTTP/1.1
> Host: localhost:27373
> User-Agent: curl/8.2.1
> Accept: */*
> Content-Length: 49
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 204
< X-Frame-Options: SAMEORIGIN
< X-Content-Type-Options: nosniff
* Added cookie JSESSIONID="5694216FB0BD8DF5BDC522678E919337" for domain localhost, path /, expire 0
< Set-Cookie: JSESSIONID=5694216FB0BD8DF5BDC522678E919337; Path=/; HttpOnly; SameSite=Lax
* Added cookie X-Bonita-API-Token="59f65158-d8d7-4bd3-a857-f80df4745b9b" for domain localhost, path /, expire 0
< Set-Cookie: X-Bonita-API-Token=59f65158-d8d7-4bd3-a857-f80df4745b9b; Path=/; SameSite=Lax
* Added cookie BOS_Locale="es" for domain localhost, path /, expire 0
< Set-Cookie: BOS_Locale=es; Path=/; SameSite=Lax
< Date: Wed, 11 Oct 2023 18:12:43 GMT
<
* Connection #0 to host localhost left intact

And finish testing for send the message with that generate error Status 401 (Unauthorized):

curl -b cookies.txt -X POST http://localhost:27373/bonita/API/bpm/message -H 'Content-Type: application/json' -d '{
"messageName": "SolicitarMensaje",
"targetProcess": "hiring-flow",
"targetFlowNode": "InicioPorMensaje"
}' -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* processing: http://localhost:27373/bonita/API/bpm/message
* Trying [::1]:27373...
* Connected to localhost (::1) port 27373
> POST /bonita/API/bpm/message HTTP/1.1
> Host: localhost:27373
> User-Agent: curl/8.2.1
> Accept: */*
> Cookie: X-Bonita-API-Token=59f65158-d8d7-4bd3-a857-f80df4745b9b; JSESSIONID=5694216FB0BD8DF5BDC522678E919337; BOS_Locale=es
> Content-Type: application/json
> Content-Length: 119
>
< HTTP/1.1 401
< Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate
< X-Frame-Options: SAMEORIGIN
< X-Content-Type-Options: nosniff
< Transfer-Encoding: chunked
< Date: Wed, 11 Oct 2023 18:13:10 GMT
<
* Connection #0 to host localhost left intact

Afret testing with the connection with response Status 200 OK:

curl -b cookies.txt -X GET http://localhost:27373/bonita/API/bpm/case/22005 -v
Note: Unnecessary use of -X or --request, GET is already inferred.
* processing: http://localhost:27373/bonita/API/bpm/case/22005
* Trying [::1]:27373...
* Connected to localhost (::1) port 27373
> GET /bonita/API/bpm/case/22005 HTTP/1.1
> Host: localhost:27373
> User-Agent: curl/8.2.1
> Accept: */*
> Cookie: X-Bonita-API-Token=59f65158-d8d7-4bd3-a857-f80df4745b9b; JSESSIONID=5694216FB0BD8DF5BDC522678E919337; BOS_Locale=es
>
< HTTP/1.1 200
< Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate
< X-Frame-Options: SAMEORIGIN
< X-Content-Type-Options: nosniff
< Content-Type: application/json;charset=UTF-8
< Transfer-Encoding: chunked
< Date: Wed, 11 Oct 2023 18:13:00 GMT
<
{"end_date":"","searchIndex5Label":"","processDefinitionId":"8579726731886515492","searchIndex3Value":"","searchIndex4Value":"","searchIndex2Label":"","start":"2023-10-11 12:06:56.148","searchIndex1Value":"","searchIndex3Label":"","startedBySubstitute":"0","searchIndex5Value":"","searchIndex2Value":"","rootCaseId":"22005","id":"22005","state":"started","searchIndex1Label":"","started_by":"0","searchIndex4Label":"","last_update_date":"2023-10-11 12:06:56.148"}* Connection #0 to host localhost left intact

How assing permisions for execute the API for create message or active it?

No answers yet.
Notifications