DirectLine token is getting expired and I'm not able to generate a new one(using websocket)
See original GitHub issueFrom @prajwalsimha94 on October 21, 2018 15:16
I’m using BotFramework DirectLine websocket to post and receive messages with the bot. While it works fine, the directline token expires in about half hour, forcing my app to generate a new token. I’m using the following code to subscribe to “Token Expired” event:
directline.connectionStatus$
.subscribe(function(connectionStatus)) {
switch(connectionStatus){
case BotChat.ConnectionStatus.Uninitialized:
//some code
break;
case BotChat.ConnectionStatus.Connecting:
//some code
break;
case BotChat.ConnectionStatus.Online:
//some code
break;
case BotChat.ConnectionStatus.ExpiredToken:
// generate a new token and reconnect to the conversation
break;
}
}
The problem is, case “BotChat.ConnectionStatus.ExpiredToken” is not getting triggered even if the token is expired. But while using the POLLING approach the expired token event gets triggered.
Browser console throws error 403 forbidden when I try to post an activity after the token is expired. Any help would be appreciated. Thanks!
Copied from original issue: Microsoft/BotFramework-WebChat#1223
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:9 (3 by maintainers)
Top Results From Across the Web
DirectLine token is getting expired and I'm not able to ...
I'm using BotFramework DirectLine websocket to post and receive messages with the bot. While it works fine, the directline token expires in ...
Read more >Direct Line Authentication in Azure Bot Service - Microsoft Learn
If the request is successful, the response contains a new token that is valid for the same conversation as the previous token and...
Read more >asksuite-botframework-directlinejs - npm
Start using asksuite-botframework-directlinejs in your project by running `npm i asksuite-botframework-directlinejs`. There are no other ...
Read more >botframework-directline-angular6 - npm package - Snyk
client library for the Microsoft Bot Framework Direct Line 3.0 protocol. THIS IS A BETA TESTING PROJECT TO MAKE THIS PROJECT COMPATIBLE WITH...
Read more >The WebSocket API (WebSockets) - Web APIs - MDN Web Docs
desktop desktop
Chrome Edge
WebSocket Full support. Chrome4. Toggle history Full support. Edge12. Toggl...
WebSocket() constructor Full support. Chrome4. Toggle history Full support. Edge12. Toggl...
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
@vincec-msft We have enabled websocket in our webchat by doing a minor code changes in DirectlineJS dependency. Though “using watermark to fetch history messages” is working fine, we are facing THIS issue with ExpiredToken event. ExpiredToken event is not triggered when token actually gets expired…
Can you please guide us on this?
@compulim this is still an issue