Skip to content

Conversation

@keegan-caruso
Copy link
Contributor

Check for null in PrepareAuthorityInstanceForMsal

Description

Check for null in PrepareAuthorityInstanceForMsal

Fixes #3337

@keegan-caruso keegan-caruso requested a review from a team as a code owner April 19, 2025 01:25
@keegan-caruso keegan-caruso self-assigned this Apr 21, 2025
@keegan-caruso keegan-caruso merged commit c33e90f into master Apr 29, 2025
5 checks passed
@keegan-caruso keegan-caruso deleted the kecaruso/instance-null branch April 29, 2025 19:26
{
if (string.IsNullOrEmpty(Instance))
{
return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is curing a symptom, not the root cause, which is that the authentication scheme is likely to be wrong, or the developer didn't provide Instance/TenantId or Authority

Maybe we should just throw a meaningful exception instead?
"Intance+TenantId or Authority not provided for authentication scheme/named options {named options}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, I had forgotten to submit the review ... days ago

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point, we can revert this and throw a meaningful exception.

keegan-caruso added a commit that referenced this pull request Apr 30, 2025
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.

MergedOptions Instance can be null on attempted access

6 participants