Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

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

Open
thisislondon opened this issue Jan 3, 2018 · 2 comments

Comments

@thisislondon
Copy link

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
Copy link
Contributor

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
Copy link
Author

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

$ nexmo --version
0.4.3-beta-2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants