Use `java.nio.charset.StandardCharsets` instead of `com.nimbusds.jose.util.StandardCharset` in persistence msal4extensions
In the persitence msal4extensions, a unusual StandardCharset is used instead of the default java.nio.
This causes issues e.g. during native build.
Error: Discovered unresolved type during parsing: com.nimbusds.jose.util.StandardCharset. This error is reported at image build time because class com.microsoft.aad.msal4jextensions.PersistenceTokenCacheAccessAspect is registered for linking at image build time by command line and command line.
Error encountered while parsing com.microsoft.aad.msal4jextensions.PersistenceTokenCacheAccessAspect.afterCacheAccess(PersistenceTokenCacheAccessAspect.java:143)
There seems no reason to use com.nimbusds.jose.util.StandardCharset over java.nio. Therefor the import should be changed to avoid dependency issues.
https://github.com/AzureAD/microsoft-authentication-library-for-java/blob/b6f54ca13957b8d9e20823bf5c776de543518fa7/msal4j-persistence-extension/src/main/java/com/microsoft/aad/msal4jextensions/PersistenceTokenCacheAccessAspect.java#L127C84-L127C99
Current workaround is to provide a stupid implementation with the same classpath for native build:
package com.nimbusds.jose.util;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
public class StandardCharset {
public static Charset UTF_8 = StandardCharsets.UTF_8;
}
@Avery-Dunn do you find time to have a look at this? Would be very much appreciated
Sorry for the delay, I just merged in your PR. We don't have an ETA for the release as there are some other small changes we want to get in, but I'll update this thread once it's out.
@Avery-Dunn all good 🙂 Thank you very much 👍
Close as merged