Token fail/Authentication

I am trying to GET the applications after login, but the API returns this error.
Somebody have an idea how can I resolve this issue?

  1. error: “authentication failed: get token from context error: no authorization-data in metadata”,…}

  2. code: 16

  3. details: []

  4. error: “authentication failed: get token from context error: no authorization-data in metadata”

  5. message: “authentication failed: get token from context error: no authorization-data in metadata”

1 Like

Please see: Using REST API with JWT_TOKEN

1 Like

The headers should be as below?
var myHeadersApplication = new Headers();
myHeadersApplication.append(“Accept”, “application/json”);
myHeadersApplication.append(“Grpc-Metadata-Authorization”, jwt.jwt);
fetch(‘http://XXXXXXXXX/api/applications’,{
method: ‘GET’,
Authorization: ‘Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJsb3JhLWFwcC1zZXJ2ZXIiLCJleHAiOjE1NzM1NzE4MDksImlzcyI6ImxvcmEtYXBwLXNlcnZlciIsIm5iZiI6MTU3MzQ4NTQwOSwic3ViIjoidXNlciIsInVzZXJuYW1lIjoiYWRtaW4ifQ._iGFgdzw9pvxnepejPtOyWD4LV4j6ncYkbcSifwVHV4’,
header: {
myHeadersApplication
},
})

Hello,
I’m getting “authentication failed: get token from context error: no authorization-data in metadata” when I click “try it out!” @ http://myhost:8080/api.
My JWT token is “eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJsb3JhLWFwcC1zZXJ2ZXIiLCJhdWQiOiJsb3JhLWFwcC1zZXJ2ZXIiLCJuYmYiOjE0ODk1NjY5NTgsImV4cCI6MTcxNDc2NDgwMCwic3ViIjoidXNlciIsInVzZXJuYW1lIjoiYWRtaW4ifQ.SRH_3K6aPu3AzD2DIjXHmTMkvKjjF4mS8ma3hJ8R6cE”
which has this payload:
{
“iss”: “lora-app-server”,
“aud”: “lora-app-server”,
“nbf”: 1489566958,
“exp”: 1714764800,
“sub”: “user”,
“username”: “admin”
}
Am I missing something in the payload?
Just re-tried from scratch and am now getting:
“authentication failed: jwt parse error: signature is invalid”
using secret: “4NXq2MfNMDiVmMa17N7ntj+v1eP/SGxXMcMwbO4xs=”
I did not tick the base64 option.

Hi Did you get an answer to this.

I am seeing a similar issue but getting “authentication failed: not authorized”
My ex.
{
“aud”: “lora-app-server”,
“iss”: “lora-app-server”,
“sub”: “user”,
“username”: “gary@heatboss.co.uk
}

The user exists in Chirpstack and is an admin… I have set the jwt_secret in the toml app-server file and use the above properties in JWT to generate the token…

Can’t figure this out. Can someone please help.

I’m not sure about the actual issue, but please note that the recommended way to authenticate with the API is API keys that you can generate using the web-interface.