You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use a client assertion as our client credential when building our confidential client application. This assertion comes from a file stored locally and gets refreshed every hour. At the moment the credential can only be created before the confidential client application is created, even when using the createFromCallback method meaning we need to create a whole new confidential client application everytime the token is refreshed.
Proposed solution
Ideally we would like to build one confidential client application that refreshes this client credential on every acquire token request.
I can see that we can create a client credential from a callback using createFromCallback but this still gets executed when the confidential client is created. Ideally this callback should be executed when the acquireToken method is called.
Alternatives
At the moment we need to either create a new confidential client for every request or somehow build a new confidential client every time the token is updated.
+1 for this one. The .NET library provides a builder with WithClientAssertion(). The builder with plain string is obsolete. Node has also implemented async callbacks: AzureAD/microsoft-authentication-library-for-js#7014
The bug you mentioned prevented the callback from being called more then once we configured at the app-level, but you may have still be able to set the assertion on each request when using ClientCredentialParameters.clientCredential()
The changes in #988 should resolve this problem by fixing the bug and generally improving assertion behavior, so that the callback is called every time the assertion is needed. Let use know if you still have any issues after updating to 1.23.1
Activity
pdefreitas commentedon May 2, 2025
+1 for this one. The .NET library provides a builder with WithClientAssertion(). The builder with plain string is obsolete. Node has also implemented async callbacks:
AzureAD/microsoft-authentication-library-for-js#7014
Avery-Dunn commentedon Sep 12, 2025
Sorry for the slow response, however version 1.23.1 has been released containing a fix for this issue: https://github.com/AzureAD/microsoft-authentication-library-for-java/releases/tag/v1.23.1
The bug you mentioned prevented the callback from being called more then once we configured at the app-level, but you may have still be able to set the assertion on each request when using
ClientCredentialParameters.clientCredential()The changes in #988 should resolve this problem by fixing the bug and generally improving assertion behavior, so that the callback is called every time the assertion is needed. Let use know if you still have any issues after updating to 1.23.1