Skip to content

Add RequestedAccessTokenVersion setting - #11

Merged
StefH merged 2 commits into
mainfrom
requestedAccessTokenVersion
Sep 10, 2025
Merged

StefH merged 2 commits into
mainfrom
requestedAccessTokenVersion

Conversation

@StefH

@StefH StefH commented Sep 9, 2025

Copy link
Copy Markdown
Member

No description provided.

@StefH StefH self-assigned this Sep 9, 2025
@StefH StefH added the enhancement New feature or request label Sep 9, 2025
@StefH
StefH requested a review from Copilot September 10, 2025 06:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds RequestedAccessTokenVersion setting functionality to the Azure App Registrations Manager. It introduces a new UI control to configure the access token version that Azure AD should return for the application.

  • Added new method to update RequestedAccessTokenVersion through Azure Graph API
  • Implemented UI controls for configuring the access token version (1 or 2) with validation
  • Updated the Scope page to include RequestedAccessTokenVersion settings alongside existing scope management

Reviewed Changes

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

File Description
AzureCommandsHandler.cs Added UpdateRequestedAccessTokenVersionAsync method for API calls
ScopeUserControl.xaml.cs Added RequestedAccessTokenVersion property and save functionality, removed BaseUserControl inheritance
ScopeUserControl.xaml Added UI controls for RequestedAccessTokenVersion configuration and restructured layout
OverviewUserControl.xaml.cs Removed BaseUserControl inheritance and added confirmation dialog for service principal removal

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

namespace AzureAppRegistrationsManager.WinUI.Features.Scope;

public sealed partial class ScopeUserControl : BaseUserControl
public sealed partial class ScopeUserControl

Copilot AI Sep 10, 2025

Copy link

Choose a reason for hiding this comment

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

The class no longer inherits from BaseUserControl but still calls methods like OnPropertyChanged and UpdateAppRegAsync that are likely defined in the base class. This will cause compilation errors.

Suggested change
public sealed partial class ScopeUserControl
public sealed partial class ScopeUserControl : BaseUserControl

Copilot uses AI. Check for mistakes.
namespace AzureAppRegistrationsManager.WinUI.Features.Overview;

public sealed partial class OverviewUserControl : BaseUserControl
public sealed partial class OverviewUserControl

Copilot AI Sep 10, 2025

Copy link

Choose a reason for hiding this comment

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

The class no longer inherits from BaseUserControl but still calls methods like OnPropertyChanged and UpdateAppRegAsync that are likely defined in the base class. This will cause compilation errors.

Suggested change
public sealed partial class OverviewUserControl
public sealed partial class OverviewUserControl : BaseUserControl

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +34
if (AppRegInfo.Application!.Api == null)
{
AppRegInfo.Application.Api = new ApiApplication();
}

Copilot AI Sep 10, 2025

Copy link

Choose a reason for hiding this comment

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

Using the null-forgiving operator (!) on AppRegInfo.Application assumes it's never null, but the null check for AppRegInfo suggests null values are possible. Consider using conditional access: AppRegInfo.Application?.Api

Suggested change
if (AppRegInfo.Application!.Api == null)
{
AppRegInfo.Application.Api = new ApiApplication();
}
if (AppRegInfo.Application == null)
{
AppRegInfo.Application = new Application();
}
if (AppRegInfo.Application.Api == null)
{
AppRegInfo.Application.Api = new ApiApplication();
}

Copilot uses AI. Check for mistakes.
@StefH
StefH merged commit 5c4c2a2 into main Sep 10, 2025
1 check passed
@StefH
StefH deleted the requestedAccessTokenVersion branch September 10, 2025 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants