Skip to content

Corrected OBO echange failed message #345

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

Merged
merged 2 commits into from
Jul 1, 2025

Conversation

tracyboehrer
Copy link
Member

Fixes #344

@Copilot Copilot AI review requested due to automatic review settings June 27, 2025 19:30
@tracyboehrer tracyboehrer requested a review from a team as a code owner June 27, 2025 19:30
@tracyboehrer tracyboehrer enabled auto-merge June 27, 2025 19:30
@github-actions github-actions bot added the ML: Core Tags changes to core libraries label Jun 27, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request addresses issue #344 by correcting the error messages shown when an OBO exchange fails. The key changes include:

  • Modifying the exception creation in AzureBotUserAuthorization.cs to use a simplified scopes representation.
  • Updating the error message in Resources.resx to provide additional troubleshooting guidance.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/libraries/Builder/Microsoft.Agents.Builder/UserAuth/TokenService/AzureBotUserAuthorization.cs Updated exception formatting to use the 'scopes' parameter.
src/libraries/Builder/Microsoft.Agents.Builder/Properties/Resources.resx Expanded error message text for OBO exchange failures.
Files not reviewed (1)
  • src/libraries/Builder/Microsoft.Agents.Builder/Properties/Resources.Designer.cs: Language not supported
Comments suppressed due to low confidence (2)

src/libraries/Builder/Microsoft.Agents.Builder/UserAuth/TokenService/AzureBotUserAuthorization.cs:128

  • Verify that 'scopes' is always properly initialized and handles null or empty cases, as the previous version explicitly indicated a null value when necessary.
                    throw Core.Errors.ExceptionHelper.GenerateException<InvalidOperationException>(ErrorHelper.OBOExchangeFailed, ex, [connectionName, string.Join(",", scopes)]);

src/libraries/Builder/Microsoft.Agents.Builder/UserAuth/TokenService/AzureBotUserAuthorization.cs:134

  • Ensure that the use of 'scopes' without an explicit null check retains the intended clarity from the previous implementation, especially when token acquisition returns null.
                    throw Core.Errors.ExceptionHelper.GenerateException<InvalidOperationException>(ErrorHelper.OBOExchangeFailed, null, [connectionName, string.Join(",", scopes)]);

@tracyboehrer tracyboehrer merged commit 4bd7476 into main Jul 1, 2025
8 checks passed
@tracyboehrer tracyboehrer deleted the users/tracyboehrer/obo-errormsg-fix branch July 1, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ML: Core Tags changes to core libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OBO exchange failure message incorrect
2 participants