OfficeDev / teams-toolkit

Developer tools for building Teams apps
Other
466 stars 192 forks source link

Issue with Oauth2 redirect upon signing in on Declarative Agent with existing API plugin #12722

Open michellekeoy opened 2 days ago

michellekeoy commented 2 days ago

Describe the bug Context: I am creating a custom declarative agent with an existing API plugin using OAuth2 authorization code flow.

What has been done so far:

To Reproduce Not sure if you would be able to reproduce the behaviour, but I am happy to connect and show you on a call.

Expected behavior I would assume we get redirected to the copilot chat with my custom declarative agent.

Screenshots Screenshots have sensitive information, but they don't provide much. I have described to best ability above, let me know if you need more details!

VS Code Extension Information (please complete the following information):

CLI Information (please complete the following information):

microsoft-github-policy-service[bot] commented 2 days ago

Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned.

SLdragon commented 1 day ago

Hi, @michellekeoy

I am confused about this redirect URI specifically. How does it know which chat/agent to return to?

The redirect URI is used to receive the token and will automatically close after consent, it will not return to any chat/agent.

Regarding your issue, it seems the Copilot API call failed with the token, so that it ask your consent again. This could be due to an invalid scope or other reasons. Could you share your OAuth registration info so I can take a look?

michellekeoy commented 1 day ago

@SLdragon Noted. Yes, where can I share that info in a secure place? Why did the API call fail if Okta has returned a success and I receive a 200? Scope is correct or else the access token would not have been granted.

SLdragon commented 1 day ago

Do you mean that your API service responded with a 200 status?

Can you check the API call logs in the service backend to see if it received the correct token and parameters?

michellekeoy commented 1 day ago

@SLdragon Yes, checked, correct. It is successful. It may be clearer if we hop on a call to debug instead, as I'm not sure I can send sensitive information in this forum. My timezone EST though

SLdragon commented 1 day ago

OK, you can find me on Teams rentu@microsoft.com

michellekeoy commented 1 day ago

@SLdragon Requested you on Teams