Skip to content

UserAuth fixes #289

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 3 commits into from
May 15, 2025
Merged

UserAuth fixes #289

merged 3 commits into from
May 15, 2025

Conversation

tracyboehrer
Copy link
Member

No description provided.

@Copilot Copilot AI review requested due to automatic review settings May 15, 2025 22:03
@tracyboehrer tracyboehrer requested a review from a team as a code owner May 15, 2025 22:03
@tracyboehrer tracyboehrer enabled auto-merge May 15, 2025 22:03
@github-actions github-actions bot added the ML: Core Tags changes to core libraries label May 15, 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 PR addresses issues in user authentication flows by enhancing error logging, refining handler name assignment, and adding necessary null checks.

  • Logging improvements in SignUserInAsync in UserAuthorizationDispatcher.
  • Default assignment for handlerName and corresponding changes in UserAuthorization.
  • Configuration fallback for AgentApplicationOptions and an added _userAuth null check in AgentApplication.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
UserAuthorizationDispatcher.cs Added trace logging for exceptions in the SignUserInAsync method.
UserAuthorization.cs Introduced a default assignment for handlerName and updated the dispatcher call to use handlerName directly.
AgentApplicationOptions.cs Added fallback logic for configuration sections based on the class name.
AgentApplication.cs Included an extra null check for _userAuth in the route handling logic.
Comments suppressed due to low confidence (3)

src/libraries/Builder/Microsoft.Agents.Builder/App/AgentApplicationOptions.cs:137

  • Consider adding a comment to explain the rationale for falling back to the configuration section named after the class to improve future maintainability.
if (!section.Exists()) { ... section = configuration.GetSection(nameof(AgentApplicationOptions)); }

src/libraries/Builder/Microsoft.Agents.Builder/App/UserAuth/UserAuthorization.cs:125

  • [nitpick] With the null-coalescing assignment ensuring a default value for handlerName, using handlerName directly in the dispatcher call is safe; please verify that this change fully aligns with the expected behavior in all scenarios.
handlerName ??= DefaultHandlerName;

src/libraries/Builder/Microsoft.Agents.Builder/App/AgentApplication.cs:746

  • The added null check for _userAuth helps prevent potential runtime errors; ensure that this change aligns with the intended route selection and sign-in behavior.
if (_userAuth == null || route.AutoSignInHandler == null || route.AutoSignInHandler.Length == 0)

tracyboehrer and others added 2 commits May 15, 2025 17:05
…thorizationDispatcher.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@tracyboehrer tracyboehrer merged commit 7f59b83 into main May 15, 2025
8 checks passed
@tracyboehrer tracyboehrer deleted the users/tracyboehrer/oauth-config branch May 15, 2025 23:34
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.

2 participants