Hello,
so It’s not tricky for me to debug this problem however I progressed a little, maybe an expert could find the bug or the issue.
If I’m using the REST API with my terminal (debian bash shell) It works just I need to add Authorization Bearer in my request.
First I recover the token from the API with api/internal/login method directly from the UI or from the terminal both work:
root@Debian02:~# curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -k -d '{ "password": "PASSWORD", "username": "USERNAME" }' 'https://192.168.0.5:8080/api/internal/login'
Output ==> <MY_TOKEN>
and then if I use a GET method from my terminal with Authorization Bearer it works;
curl -X GET --header 'Accept: application/json' 'https://192.168.0.5:8080/api/applications/1' -k --header "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJsb3JhLWFwcC1ZzXJ2ZXIiLCJleHAiOjE1MzMyNDc1MjAsImlzcyI6ImxvcmEtYXBwLXNlcnZlciIsIm5iZiI6MTUzMzE2MTEyCMwic3ViIjoidXNlciIsInVzZXJuYW1lIjoiYWRtaW4ifQ.yV0ehfN8X1AmmFRW_EN5dv3swCG8dFiI4UPx3RnYy4r"
Output ==> {"id":"1","name":"myHomeLab","description":"homeTest","organizationID":"1","serviceProfileID":"f2a511e0-d46d-4262-8c55-471728145f7a","payloadCodec":"CAYENNE_LPP","payloadEncoderScript":"","payloadDecoderScript":""}
On the other side if I used the same TOKEN with UI REST API I have got the snapshot issue posted above.
and I can’t use the REST API:
Response Body: {
“error”: “authentication failed: get token from context error: no authorization-data in metadata”,
“code”: 16
}
@brocaar or someone else do you have an idea?
Thank you for your help.