Skip to content
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

Add Scopes validation for ClientCredentials authentication #10

Closed
wants to merge 1 commit into from

Conversation

ceciliaavila
Copy link
Collaborator

Description

This PR adds a validation for the Scopes setting, as at least one scope is required in the list for ClientCredentials authentication.
It also adds a new unit test to cover this case.

Detailed Changes

  • Added new validation in the GetAccessTokenAsync method of the MsalAuth class.
  • Added a condition to avoid NullReferenceExceptions when there are no Scopes in the settings in the ResolveScopesList method.
  • Added a unit tests to cover the new validation in MsalAuthTests.

Testing

These images show the new exception thrown when the Scopes are not part of the settings and the new test passing.
image
image

@ceciliaavila
Copy link
Collaborator Author

/promoted 85

@ceciliaavila ceciliaavila deleted the southworks/add/msal-scopes-validation branch February 5, 2025 16:30
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.

2 participants