-
Notifications
You must be signed in to change notification settings - Fork 345
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
[Bug] .WithTenantId started to throw ArgumentException #4280
Comments
Today we throw an ArgumentException if authority URl is malformed (e.g. has spaces in it). We should throw an MsalClientException |
Between 4.50 and 4.55, the exceptions in calling only |
@rabenshm Can you clarify which method you called and what the exception you were expecting, I wasn;t able to find the exact scenario. |
We were calling .WithTenantId , but we were only getting exception when calling the AcquireToken and not in the Builder level.
After your change we are getting the exception on the builder level.
…________________________________
From: Peter ***@***.***>
Sent: Wednesday, September 27, 2023 9:22 AM
To: AzureAD/microsoft-authentication-library-for-dotnet ***@***.***>
Cc: Ran Ben Shmuel ***@***.***>; Mention ***@***.***>
Subject: Re: [AzureAD/microsoft-authentication-library-for-dotnet] [Bug] .WithTenantId started to throw ArgumentException (Issue #4280)
@rabenshm<https://github.com/rabenshm> Can you clarify which method you called and what the exception you were expecting, I wasn;t able to find the exact scenario.
[image]<https://user-images.githubusercontent.com/34331512/268195102-d711b2de-0c9d-4347-9e4f-e4e9df231f67.png>
—
Reply to this email directly, view it on GitHub<#4280 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASTLGO4IPE67IZ7GN2F76DTX4PA2HANCNFSM6AAAAAA26DI2YU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@rabenshm - changes in this part of the code are quite complex and this problem has not been reported by others. Is it so complex to update your code to take into account the new behavior? MSAL is just detecting an invalid URI earlier, in the app builder. |
Library version used
4.55.0
.NET version
4.8
MSAL client type
Confidential
Application type
Web API
Authentication flow type
Client credentials (service-to-service calls)
Is this a new or an existing app?
The app is in production, and I have upgraded to a new version of MSAL
Issue description and reproduction steps
Well calling on the ConfidentialClientApplication builder .WithTenantId with invalid tenant, a new argument exception regarding authorityurl is being throw, although we do not explictly set authorityurl by ourselves, and this is not declared as a thrown exception.
Until now we handled MsalException for those scenario. As discussed offline with Bogdan suggest to change to MsalClientException not to break flows.
For now we have rolled back to previous MSAL version.
Relevant code snippets
No response
Expected behavior
MsalClientException should be thrown , better on the Execute and not in the builder (even if MSAL itself will not go our for STS)
Identity provider
Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)
Regression
4.50
Solution and workarounds
No response
The text was updated successfully, but these errors were encountered: