Nexmo / nexmo-cli

Nexmo CLI (Command Line Interface)
https://nexmo.com
MIT License
78 stars 52 forks source link

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

Open thisislondon opened 6 years ago

thisislondon commented 6 years ago

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

AlexLakatos commented 6 years ago

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

thisislondon commented 6 years ago

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

$ nexmo --version 0.4.3-beta-2