0
votes

When I generate a Directline v3 token the response contains an expires_in value of 1800. Does this mean the token expires after 1800 seconds of inactivity?

https://github.com/microsoft/botframework-directlinejs#reconnect-to-a-conversation says that the directline token refreshes every 15 mins. Does this mean as long as the client is connected the token will keep getting refreshed every 15 mins, regardless of activity?

1

1 Answers

2
votes

Inactivity has no affect on the token. The token expiration is baked into the token itself, and activity will not affect that expiration time. The client is responsible for refreshing the token. Web Chat uses DirectLineJs internally, and you can see here that it refreshes the token every 15 minutes.

More information can be found here: https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-authentication?view=azure-bot-service-4.0#refresh-token

POST https://directline.botframework.com/v3/directline/tokens/refresh
Authorization: Bearer TOKEN_TO_BE_REFRESHED

If successful, will return:

{
  "conversationId": "abc123",
  "token": "RCurR_XV9ZA.cwA.BKA.y8qbOF5xPGfiCpg4Fv0y8qqbOF5x8qbOF5xniaJrC8xpy8qbOF5xnR2vtCX7CZj0LdjAPGfiCpg4Fv0",
  "expires_in": 1800
}