Skip to content

Implement correct metadata interface for RequiredScopeOrAppPermission extension method#3352

Merged
jmprieur merged 3 commits into
AzureAD:masterfrom
evan-buss:fix/3323-scope-or-app-permission-extension
May 15, 2025
Merged

Implement correct metadata interface for RequiredScopeOrAppPermission extension method#3352
jmprieur merged 3 commits into
AzureAD:masterfrom
evan-buss:fix/3323-scope-or-app-permission-extension

Conversation

@evan-buss
Copy link
Copy Markdown
Contributor

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Updates the RequiredScopeOrAppPermissionMetadata class to implement IAuthRequiredScopeOrAppPermissionMetadata rather than IAuthRequiredScopeMetadata. This makes it conform to the type that the ScopeOrAppPermissionAuthorizationHandler looks for in order to determine what scopes and app permissions to check for.

Description

Also added a new unit test file that tests the extension method by creating an endpoint with the appropriate metadata. This test fails when you swap back to IAuthRequiredScope.

Fixes #3323

@evan-buss evan-buss requested a review from a team as a code owner May 2, 2025 20:03
@evan-buss
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@evan-buss evan-buss force-pushed the fix/3323-scope-or-app-permission-extension branch from 481dd2f to 4e977d9 Compare May 2, 2025 20:07
@evan-buss evan-buss force-pushed the fix/3323-scope-or-app-permission-extension branch from 893eba1 to 3e47595 Compare May 2, 2025 20:18
Copy link
Copy Markdown
Collaborator

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks @evan-buss

@jmprieur jmprieur merged commit 93c3c26 into AzureAD:master May 15, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minimal API RequiredScopeOrAppPermission Extension Method Doesn't Work

3 participants