azure-webpubsub icon indicating copy to clipboard operation
azure-webpubsub copied to clipboard

JS chat example fail on client connection: HTTP Authentication failed

Open adiazcan opened this issue 4 years ago • 1 comments

I'm testing the service using the chat example and it doesn't work for me.

Following the documentation or downloading the JavaScript chat example from https://github.com/Azure/azure-webpubsub/tree/main/samples/javascript/chatapp, always find an "HTTP Authentication failed; no valid credentials available" when the client try to open a websocket connection with the token url.

image

WIth the Live Trace Tool, I found the following message that doesn't help so much

image

And the ngrok always has a 401 error on eventhandler

image

I also checked the token at jwt.ms and It's seemed good

image

any help?

adiazcan avatar Jun 21 '21 15:06 adiazcan

The live trace shows that you've registered connect event and it returns 401 image

So for this chat sample, the sample code only configured connected event, you can either:

  1. Update event handler in the portal to uncheck connect event:

image

  1. Or update the node.js server code to handle connect event: image

vicancy avatar Jun 22 '21 05:06 vicancy