But I’m struggling a bit with creating the JWT token:
The API token (retrieved using the web-interface).
api_token = “…”
It’s not really clear to me what I need to do. There is a lot of information here in the forum, but somehow I can’t find the right answer.
I have tried to create an api_token from the ChripStackApplication Server REST API and from JSON Web Tokens. Unfortunately without success in both ways. I always get the message:
_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAUTHENTICATED
details = “authentication failed: jwt parse error: signature is invalid”
debug_error_string = “{“created”:”@1000000000.200000000",“description”:“Error received from peer ipv4:xxx.xxx.xxx.xxx:8080”,“file”:“src/core/lib/surface/call.cc”,“file_line”:904,“grpc_message”:“authentication failed: jwt parse error: signature is invalid”,“grpc_status”:16}"
Maybe there is a documentation where I can find all the information to create/setup it and I just haven’t found it yet.
@Jakob Thank you for this example. It can be reproduced very well directly on the server (DeviceService - GET - DeviceService/List). But for running your python code I need to create first the api_token on my side.
When I create a new global API key to get a token. I get the message:
_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.NOT_FOUND
details = "object does not exist"
When I rename ‘Bearer’ to my ‘new name’ I get the message:
_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAUTHENTICATED
details = "authentication failed: jwt parse error: illegal base64 data at input byte 9"