-
Notifications
You must be signed in to change notification settings - Fork 147
[Bug] ManagedIdentity broken in 1.18.0 and up #915
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
Comments
Could you provide some more info about the exact error you're getting (logs and/or stack trace), and where you're getting it? Were any other dependencies updated or just I haven't yet tested your code in an environment where the Managed Identity request should work, but as an example I can get that same "Managed Identity authentication is not available." error message by simply cancelling the request. That error message is coming from There was one change for Azure Arc scenarios in v1.18.0 (#884), but that doesn't seem to be the problem here and I'm not sure what other changes would've caused this. The only other thing I could think of is a change in |
the error message is misleading and not very helpful, I got the same error msg when we made a typo in the scope and specified "http" instead of "https". The only dependencies used are azure-identity 1.15.3 and msal4j 1.19.0 Here's the stack trace
|
oh, it's a version mismatch in the jackson dependencies. looks like you guys bumped the jackson-databind version explicitly in 1.18.0 in #887 but azure-identity uses azure-core which is still on 2.17.2. If I explicitly add a dependency for the jackson-databind version to 2.17.2 which effectively disables the msal specified version then this works, but we do not want to add a hard dependency on this in the jdbc driver. This is a bit of a pain, and may cause issues in the future as well. Why isn't msal also using azure-core? I thought that is a shared library for java?? |
I agree, "not available" is very misleading wording for that sort of error case. That error message is coming from Azure SDK, so their repo would be a better place to point out this problem: https://github.com/Azure/azure-sdk-for-java/issues
I'm not sure why it wasn't used historically, however we're currently working on cleaning up our dependencies because of the exact problems you're running into: #909 One of the first dependencies we've started working on is jackson-databind and are aligning with dependencies used in azure-identity, so the next release will use either |
ok we got around this problem by removing msal as an explicit dependency! since azure-identity depends on msal it's now just a transitive dependency for the driver as well so it will just use jackson-bind 2.17.2 and avoids out problem :) Thanks for your help you can close this issue as the problem is resolved at our end. |
Glad to hear it! If you ever run into other issues with MSAL feel free to reach out again. |
Library version used
1.18.0, 1.19.0
Java version
23
Scenario
ManagedIdentityClient - managed identity
Is this a new or an existing app?
None
Issue description and reproduction steps
We (Microsoft JDBC Driver for SQL Server) are trying to update to the latest msal4j version that fixed the vulnerability in earlier versions however Managed Identity is broken in this version.
The following repro works for 1.17.3 and older versions but throws error ""Managed Identity authentication is not available." for 1.18.0 and 1.19.0
Relevant code snippets
Expected behavior
No response
Identity provider
Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)
Regression
1.17.3
Solution and workarounds
No response
The text was updated successfully, but these errors were encountered: