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
{{ message }}
Repository navigation
[Feature Request] Support refreshing Client Assertion #977
Our company is starting to look at using SPIFFE/SPIRE to generate short lived tokens that we are using as our client assertion. We are currently needing to write our own implementation to retrieve a new Token when the original client assertion expires.
Proposed solution
It looks like this functionality has been added to the dotnet version as the WithClientAssertion function. Would be useful to have something similar as a callback function whenever the client assertion expires.
Alternatives
Currently we have had to move away from the msal4j library and handling making call to generate a token and caching it as well as handling when the client assertion expires, but seems like this functionality would be useful in the msal4j library.
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
CodyPolton commentedon Sep 3, 2025
Any timeline for this enhancement?
Avery-Dunn commentedon Sep 12, 2025
Sorry for the lack of timeline, 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
ClientCredentialFactory.createFromCallback()was intended to match MSAL .NET's behavior of allowing a callback method to provide the assertion. A bug prevented the callback from being called more then once we configured at the app-level, but you could still set the assertion on each request when usingClientCredentialParameters.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