Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
PjPraveenkumar opened this issue Aug 14, 2024 · 11 comments
Assignees
Labels
blocked bug Something isn't working dotnet Change/fix applies to dotnet. If all three, use the 'JS & dotnet & Python' label

Comments

@PjPraveenkumar
Copy link

PjPraveenkumar commented Aug 14, 2024

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 PjPraveenkumar added the bug Something isn't working label Aug 14, 2024
@PjPraveenkumar
Copy link
Author

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
Copy link
Collaborator

@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
Copy link

@singhk97 has raised an issue around this: #1933 (comment)

@corinagum corinagum added the dotnet Change/fix applies to dotnet. If all three, use the 'JS & dotnet & Python' label label Aug 20, 2024
@PjPraveenkumar
Copy link
Author

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

@singhk97
Copy link
Collaborator

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

@singhk97
Copy link
Collaborator

singhk97 commented Sep 4, 2024

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

@corinagum
Copy link
Collaborator

Bug has been reported to teams client team internally.

@corinagum

This comment was marked as outdated.

@corinagum corinagum reopened this Oct 4, 2024
@corinagum
Copy link
Collaborator

corinagum commented Oct 4, 2024

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
Copy link
Collaborator

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
Copy link
Collaborator

aacebo commented Oct 22, 2024

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

@aacebo aacebo closed this as completed Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked bug Something isn't working dotnet Change/fix applies to dotnet. If all three, use the 'JS & dotnet & Python' label
Projects
None yet
Development

No branches or pull requests

5 participants