ACS Client (using Teams Identity) is reusing Stale Token

Dr Dave H 115 Reputation points
2024-03-07T12:14:02.92+00:00

We are using the Azure Communication Calling client library for JavaScript to build a web-based softphone for voice calling. The client is using the Teams interoperability option of having the identity as a Teams user (rather than the BYOI model).

Since moving to the 1.22.3 (or 1.22.1) stable SDK (from 1.20.1) we have noticed an issue with the proactive token renewal mechanism which previously worked fine. In our code we don't specify an initial token, just a token refresher function, and set "refreshProactively" to true. Since there is no initial token, the refresher callback function is called immediately, our code provides a suitable token, and everything works as expected.

However, when the token is due to expire and the refresher callback is called again, the SDK appears to ignore the new token we return, resulting in subsequent operations failing (such as answering incoming calls or making outbound calls). The refresher mechanism itself seems happy that the token we've provided is ok, as it doesn't trigger a new refresher callback until the new token is about to expire. The issue appears to be that the SDK is continuing to use the original (now stale) token.

The release notes don't appear to suggest that anything has changed in this specific area but tests using various SDK versions show that something has been altered which is causing this issue somewhere between SDK version 1.21.1 (works ok) and version 1.22.1 (has issue).

Any help in this matter will be gratefully received. Many thanks in advance, cheers Dave

To Reproduce

  1. Start ACS softphone
  2. Check can make outgoing calls ok
  3. Wait for approximately 1 hour
  4. Try to make outgoing call - Dial should fail

Details

  • Package Name: @azure/communication-calling
  • Package Version: Stable (v1.22.3)
  • Operating system: Windows
Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
675 questions
{count} votes

Accepted answer
  1. ajkuma 22,161 Reputation points Microsoft Employee
    2024-03-08T10:07:12.22+00:00

    edit:

    To benefit the community, posting our private discussion. The issue was due to a bug, our product engineering team have rolled out a fix.

    Dr Dave H, thanks for sharing all the requested info and reporting this issue.

    Much appreciate your feedback and patience throughout this.

    -- (1st comment) : Thanks for reporting this issue. I'm checking on this internally and will get back to you shortly.


    Please click Accept Answer - it will benefit the community to find the answers quickly.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful