Retrieve API data Microsoft Health Bot - Authorization error JWT verification failed

61 Views Asked by At

I tried to retrieve the API data from Microsoft health bot by following this repo documentation: https://github.com/microsoft/HealthBotCodeSnippets/tree/master/HealthAgentAPI in which the GET API endpoint suppose to be https://us.healthbot.microsoft.com/api/account/${tenantName}/scenarios.

Where the JWT sign token should be:

{
  "tenantName": "myTenant", (tenant is from my Health bot portal)<br />
  "iat": "1648533033"  
}

(I put year of 2022, iat value I got from Unix Time Stamp: https://www.unixtimestamp.com/)

So I place the above tenantName and iat in the JWT website (https://jwt.io/) to generate the JWT token.
On the Postman: I do GET request with the above endpoint and on the header tab, I place Authorization as KEY and the VALUE of Bearer <JWT Token just generated>.

The response was Authorization error - JWT verification failed 400 Bad request

Could anyone help spot any of my mistake?

1

There are 1 best solutions below

0
On

The solution was I didn't put the correct secret on VERIFY SIGNATURE when I was generating the JWT token, so you when Decoded you also need to put the correct secret value where you can find on MS Portal of your Health bot in
Integration section > secret > API_JWT_SECRET

Cheer, hope this answer help you too.