Closed PhllpSchrdr-boop closed 8 months ago
@KarishmaGhiya I was able to repro this - happy to pair if you'd like on the investigation. From looking around a little bit it does look like we should be calling initialize
sometime before handleRedirect or (ideally) use the static factory function which will call initialize as part of its implementation
But.... I have not looked at this code closely yet and would need your ๐ to confirm ๐
Maor,
Thanks for the contact.
For now, I am going to use v2.1.0 . I will keep an eye on the issue if your team determines the resolution. I would like to be able to use the latest version.
@PhllpSchrdr-boop thank you for bringing this issue to our attention - I especially appreciate the minimal repro steps which allowed me to quickly reproduce this. Next we will discuss internally on an appropriate path forward - meanwhile I am happy to hear 2.1.0 works for you but I would love to get your upgrade unblocked as soon as we can ๐
Stay tuned!
@PhllpSchrdr-boop As we are investigating into this issue, can you check what version of @azure/msal-browser is this using maybe under your package-lock.json OR under node_modules
folder?
@azure/msal-browser is 3.7.0
Attached is the full package-lock.json for your reference.
Hello, we have identified what the bug is and currently working on it for the fix.
Great! I will be on the lookout.
๐ Hiya @PhllpSchrdr-boop and @bramvdbruggen - we have a fix implemented and released to our dev tag. We'd love your take on whether it resolves your issue!
In order to get the latest development version you'd want to npm install @azure/identity@dev
You could then confirm you have the right version with npm ls @azure/identity
- if it shows as "4.0.1-alpha.20240118.2" you should be able to test this out.
Would love your confirmation before releasing this patch. Otherwise we will plan to release it early next week.
Thanks again!
Hi @PhllpSchrdr-boop. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
@maorleger Following your instructions and using 4.0.1-alpha.20240118.2 of @azure/identity has fixed the issue.
When can I expect a GA release?
Regards
We'll release on Monday. Thanks for confirming! :)
@maorleger Following your instructions and using 4.0.1-alpha.20240118.2 of @azure/identity has fixed the issue.
My issues have also been resolved with this fix! I will be awaiting the release on Monday.
Hiya folks, 4.0.1 has been released with the fix. We will work on backporting the fix to 3.4 as well and will update this thread when that has been released
Hi @PhllpSchrdr-boop. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.
@PhllpSchrdr-boop The fix has been released to @azure/identity in both 4.0.1 and 3.4.2
Hi @PhllpSchrdr-boop, since you havenโt asked that we /unresolve
the issue, weโll close this out. If you believe further discussion is needed, please add a comment /unresolve
to reopen the issue.
Describe the bug When using an InteractiveBrowserCredential it throws an exception with the message:
uninitialized_public_client_application: You must call and await the initialize function before attempting to call any other MSAL API
To Reproduce Steps to reproduce the behavior:
npm install @azure/identity
ng serve
BrowserAuthError: uninitialized_public_client_application: You must call and await the initialize function before attempting to call any other MSAL API. For more visit: aka.ms/msaljs/browser-errors
Expected behavior There should not be an exception thrown
Screenshots
Additional context https://github.com/Azure/azure-sdk-for-js/blob/c7c9bd4bef175a8914cdfdfe6d8e6fe1714a926d/sdk/identity/identity/src/msal/browserFlows/msalAuthCode.ts#L48C20-L48C20
The MSALAuthCode creates a PublicClientApplication which is never initialized.
The PublicClientApplication has a static function which will create a PublicClientApplication and initialize the standard controller:
https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/603098e62124b90c13dcd6e57a7d83d95cc07ce8/lib/msal-browser/src/app/PublicClientApplication.ts#L39C8-L39C8
Reverting to v2.1.0 of azure/identity resolves the issue. Any version later than v2.1.0 exhibits the issue.