question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to generate $JWT_TOKEN for data query API

See original GitHub issue

Good day to all reader,

Thingsboard has prepared the data query API instruction Timeseries data keys API

To get the $JWT_TOKEN is to run the code below: curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"username":"tenant@thingsboard.org", "password":"tenant"}' 'http://[mylocalhostname]/api/auth/login'

I have tried using the curl.exe software in windows 10 run the code above and the result shown as below:

curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{"username":"tenant@thingsboard.org", "password":"tenant"}" "https://[mylocalhostname]/api/auth/login" -k {"status":401,"message":"Authentication failed","errorCode":10,"timestamp":1513354947224}

Therefore, I cannot get the correct TOKEN to proceed the query. Do any success cases to generate the TOKEN and the suitable tools to query the data?

Thank you and have a nice day. 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
murt30commented, Aug 28, 2019

Windows 10 Command line is the problem. Replace ’ with " and put a \ before the double quotes in the JSON object. “{"username":"tenant@thingsboard.org", "password":"tenant"}”

1reaction
mp-lokicommented, Dec 18, 2017

I was running that line in Git Bash on Windows 10. You may try Postman as well

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to secure a REST API using JWT authentication
First, the user or client app sends a sign-in request. In this step, essentially, a username, password, or any other type of sign-in...
Read more >
How to get an access token with JWT Grant
Step 1. Request application consent · Step 2. Create a JWT · Step 3. Obtain the access token · Step 4. Get your...
Read more >
Get an Authentication Token - Dataloop AI
The Dataloop API uses Auth authentication scheme, where each HTTP request has JWT attached to it via the Authorization header. Basic Flow. Initiate...
Read more >
Get Data from Rest Api with JWT
Get Data from Rest Api with JWT · 1. EndPoint of tokens : https://xxxxx.yyyyy.com/vftoken/oauth/token. with this parameters · 2. Endpoint for test https://xxxxx....
Read more >
JSON Web Token Introduction - jwt.io
JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found