Can't connect to server with token authentication.
See original GitHub issueHello, First off thank you for writing this code. We rely on NATS and js so this is very useful for us.
I have tried connecting to a remote NATS server with token authentication and can’t. My subscriptions don’t receive data I send. I’m using nats@beta
. My code works fine when testing with a local server that has token authentication. Our remote server is 3 NATS instances as a supercluster behind a Kubernetes load balancer.
Can you help me debug this? I tried Python and nats-pub/nats-sub; they work successfully.
Here is my sample code: https://gist.github.com/roguh/9c220782640279d040ee563c23300432
Here’s the output:
$
NATS_AUTH_TOKEN=... NATS_URL=nats://localhost:4222 node src/nats_test.js
subscribing to test
publishing to test
Error: test publish and subscribe failed. messages received:
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (8 by maintainers)
Top Results From Across the Web
ERROR: Could not authenticate with the provided token
Make sure the token is valid/active and the Anypoint Platform user who generates the token has "Manage Servers" permission for that environment.
Read more >Can't connect to authentification server : r/EliteDangerous
Hi, I have problems logging into the authentication server. When I start the game (via Steam VR) an error message is displayed that...
Read more >How to fix League's 'unable to connect to the authentication ...
The first thing you should do is check your server status. There's a good chance the issue isn't at your end and Riot...
Read more >Troubleshoot Invalid Token Errors - Auth0
Error Message: The ID token cannot be validated because it was signed using the HS256 algorithm and public applications (such as a browser)...
Read more >User can't authenticate or must authenticate twice
Troubleshooting an issue in which user can't authenticate or must authenticate twice when starting a remote desktop connection.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Your sample runs fine.
I caught the problem! I didn’t use
{callback: ...}
It would be helpful for you to show your server configuration.