From e2a42da64e2e0670bd9dc581b567858f41577960 Mon Sep 17 00:00:00 2001 From: kavin <115390646+singhk97@users.noreply.github.com> Date: Tue, 27 Aug 2024 12:20:00 -0700 Subject: [PATCH] [repo] fix: TeamsSsoPrompt never completes due to timeout (#1958) ## Linked issues closes: #1744 ## Details **C# fix** Changed `DateTime.Now` to `DateTime.UtcNow` when used in the `TeamsSSOPrompt`. **JS fix** No bug in JS. **PY** TeamsSSO auth is not implemented as of now. ## Attestation Checklist - [x] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (updating the doc strings in the code is sufficient) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes --- .../Application/Authentication/Bot/TeamsSsoPrompt.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/packages/Microsoft.TeamsAI/Microsoft.TeamsAI/Application/Authentication/Bot/TeamsSsoPrompt.cs b/dotnet/packages/Microsoft.TeamsAI/Microsoft.TeamsAI/Application/Authentication/Bot/TeamsSsoPrompt.cs index 3b10f3f8c..3e3ab988b 100644 --- a/dotnet/packages/Microsoft.TeamsAI/Microsoft.TeamsAI/Application/Authentication/Bot/TeamsSsoPrompt.cs +++ b/dotnet/packages/Microsoft.TeamsAI/Microsoft.TeamsAI/Application/Authentication/Bot/TeamsSsoPrompt.cs @@ -29,7 +29,7 @@ public override async Task BeginDialogAsync(DialogContext dc, int timeout = _settings.Timeout; IDictionary state = dc.ActiveDialog.State; - state[_expiresKey] = DateTime.Now.AddMilliseconds(timeout); + state[_expiresKey] = DateTime.UtcNow.AddMilliseconds(timeout); // Send OAuth card to get SSO token await this.SendOAuthCardToObtainTokenAsync(dc.Context, cancellationToken);