-
Notifications
You must be signed in to change notification settings - Fork 10
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
java.lang.ClassCastException: java.util.Collections$SingletonList cannot be cast to java.lang.String #85
Comments
@eparkhomenko thank you for bring this to our attention. I have recently made some changes that will address this issue. |
what were the changes? I'm facing a similar issue using MSAL and OAuth |
@eparkhomenko and @lanman2000 version 1.15.1 was just pushed to Maven Central, and it contains a fix for this issue. Please let us know if you have any issues are updating. |
Thank you! @IsaiahWilliams |
Hi, Can anyone guide me what exactly was the change added in 1.15.1 version to fix this issue? |
When I try to get application credentials using following code:
PartnerCredentials.getInstance().generateByApplicationCredentials(
account.getCspClientId(),
account.getCspKey(),
"/" + account.getCspDomain() // e.g. 'test.onmicrosoft.com'
);
I see such exception:
com.microsoft.store.partnercenter.exception.PartnerException: Failed to do the application AAD login at com.microsoft.store.partnercenter.extensions.ApplicationPartnerCredentials.authenticate(ApplicationPartnerCredentials.java:172) ~[partnercenter-1.14.1.jar:1.14.1] at com.microsoft.store.partnercenter.extensions.PartnerCredentials.generateByApplicationCredentials(PartnerCredentials.java:69) ~[partnercenter-1.14.1.jar:1.14.1] at com.microsoft.store.partnercenter.extensions.PartnerCredentials.generateByApplicationCredentials(PartnerCredentials.java:50) ~[partnercenter-1.14.1.jar:1.14.1] Caused by: java.util.concurrent.ExecutionException: java.lang.ClassCastException: java.util.Collections$SingletonList cannot be cast to java.lang.String at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357) ~[na:1.8.0_181] at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895) ~[na:1.8.0_181] at com.microsoft.store.partnercenter.extensions.ApplicationPartnerCredentials.authenticate(ApplicationPartnerCredentials.java:168) ~[partnercenter-1.14.1.jar:1.14.1] ... 103 common frames omitted Caused by: java.lang.ClassCastException: java.util.Collections$SingletonList cannot be cast to java.lang.String at com.nimbusds.oauth2.sdk.util.URLUtils.serializeParameters(URLUtils.java:105) ~[oauth2-oidc-sdk-5.18.1.jar:5.18.1] at com.microsoft.aad.msal4j.TokenRequest.toOauthHttpRequest(TokenRequest.java:168) ~[msal4j-0.5.0-preview.jar:0.5.0-preview] at com.microsoft.aad.msal4j.TokenRequest.executeOauthRequestAndProcessResponse(TokenRequest.java:55) ~[msal4j-0.5.0-preview.jar:0.5.0-preview] at com.microsoft.aad.msal4j.ClientApplicationBase.acquireTokenCommon(ClientApplicationBase.java:163) ~[msal4j-0.5.0-preview.jar:0.5.0-preview] at com.microsoft.aad.msal4j.AcquireTokenByAuthorizationGrantSupplier.execute(AcquireTokenByAuthorizationGrantSupplier.java:52) ~[msal4j-0.5.0-preview.jar:0.5.0-preview] at com.microsoft.aad.msal4j.AuthenticationResultSupplier.get(AuthenticationResultSupplier.java:57) ~[msal4j-0.5.0-preview.jar:0.5.0-preview] at com.microsoft.aad.msal4j.AuthenticationResultSupplier.get(AuthenticationResultSupplier.java:17) ~[msal4j-0.5.0-preview.jar:0.5.0-preview]
Environment
MacOS Mojave 10.14.6 (18G95)
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
The text was updated successfully, but these errors were encountered: