nexmo-cli icon indicating copy to clipboard operation
nexmo-cli copied to clipboard

In-app Messaging Preview for JavaScript fails because CLI Beta generates invalid JWT

Open thisislondon opened this issue 7 years ago • 2 comments

Steps to reproduce

Nexmo In-app Messaging Preview, JavaScript (web) Quickstart, is invalid because the CLI (beta version: nexmo-cli@beta) is generating a JWT token that's incompatible with the quickstart guide.

The line in the docs of note is (before we replace the "jamie" and "YOUR_APP_ID") : USER_JWT="$(nexmo jwt:generate ./private.key sub=jamie exp=$(($(date +%s)+86400)) acl='{"paths": {"/v1/sessions/**": {}, "/v1/users/**": {}, "/v1/conversations/**": {}}}' application_id=YOUR_APP_ID)"

Expected behavior

JWT should work in the HTML for JavaScript (websocket) based in-browser chat

Actual behavior

Failure, because JWT is rejected.

This has been verified by CAPI team working step-by-step through the provided web page and provided CLI.

System configuration

Node version: 8.9.3

NPM version: 3.10.3

Operating system: Linux

thisislondon avatar Jan 03 '18 16:01 thisislondon

Hi @thisislondon,

IIRC, the docs don't say to replace jamie, just YOUR_APP_ID. I can't reproduce the issue. Can you please give me some more info?

  1. What's your CLI version? nexmo --version should be 0.4.3-beta-2
  2. Can I have a look at part of your JWT? If you could go to https://jwt.io/, use your JWT in the debugger there and then paste back the payload part of it, that would help me debug this further.

Thanks, Alex

AlexLakatos avatar Jan 03 '18 17:01 AlexLakatos

I created and used a user who was not called jamie, therefore I replaced it.

$ nexmo --version 0.4.3-beta-2

thisislondon avatar Jan 03 '18 18:01 thisislondon