microsoft / teams-ai

SDK focused on building AI based applications and extensions for Microsoft Teams and other Bot Framework channels
MIT License
419 stars 184 forks source link

[Bug]: [web/desktop] Teams AI OAuth bot displays the consent dialog again if we navigate away to another chat come back #1932

Closed PjPraveenkumar closed 5 days ago

PjPraveenkumar commented 2 months ago

Language

C#

Version

latest

Description

The Teams AI OAuth bot displays the consent dialog again if we navigate away to another chat and then return to the OAuth bot chat, even though consent has already been provided. please refer below snap, code snippet: `app.Authentication.Get("graph").OnUserSignInSuccess(async (context, state) => { // Successfully logged in await context.SendActivityAsync("Successfully logged in"); await context.SendActivityAsync($"Token string length: {state.Temp.AuthTokens["graph"].Length}"); await context.SendActivityAsync($"This is what you said before the AuthFlow started: {context.Activity.Text}"); });'

'app.Authentication.Get("graph").OnUserSignInFailure(async (context, state, ex) =>
{
    // Failed to login
    await context.SendActivityAsync("Failed to login");
    await context.SendActivityAsync($"Error message: {ex.Message}");
});`

image

Consent dialog again pops up: image

Reproduction Steps

1.Set up the following sample - https://github.com/microsoft/teams-ai/tree/main/dotnet/samples/06.auth.oauth.bot
2.Go to bot chat and say "hello", then it immediately shows up the consent dialog to provide first time consent and complete the consent process. 
3.you would see successful login message. And then navigate to other chat and come back, then again it pops up the consent dialog to provide consent, it seems like enddialog wasn't properly called.
...
PjPraveenkumar commented 2 months ago

Hi @corinagum The partner is currently experiencing an issue where a continuous OAuth sign-in prompt appears even after a successful login attempt. Could you please let me confirm if there is a bug regarding this flow ? I suggested partner to utilize the end dialog context but it didn't help.

corinagum commented 2 months ago

@aacebo has been running into similar issues just on Windows with teams-ai and non-team-ai bots, so we are investigating which team to contact about this.

rajan-chari commented 2 months ago

@singhk97 has raised an issue around this: https://github.com/microsoft/teams-ai/issues/1933#issue-2466878963

PjPraveenkumar commented 2 months ago

hello @corinagum could you please share if there is any update on this issue ?

singhk97 commented 2 months ago

Hi @PjPraveenkumar we have this in the backlog and plan on tackling it in the coming 1-2 weeks

singhk97 commented 1 month ago

This seems to be a Teams Client issue ... which is out scope of the SDK.

corinagum commented 1 month ago

Bug has been reported to teams client team internally.

corinagum commented 1 month ago

Closing this issue - again this was a Teams client bug. It has now been resolved but the release cadence for Teams means that users in public ring won't see the bugs fix until late October. Please track https://github.com/microsoft/teams-ai/issues/1934 - If there is further development I will update there.

corinagum commented 3 weeks ago

Apologies for the confusion everyone. This issue is still being investigated by the Teams client team and is not fixed alongside the issue linked above. Reopening this one and will report when there are developments.

corinagum commented 2 weeks ago

For anyone tracking this bug, we are looking for more information. Is anyone able to confirm that sign in is failing when the pop-up reappears, or that subsequent invokes to the bot are failing? If yes, please provide code snippets as well as info on the network trace(s) where invokes / signin fail. Thanks!

aacebo commented 5 days ago

this was a bug in the teams client that has since been resolved