java.lang.ClassCastException
Issue #259
invalid
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
at com.nimbusds.oauth2.sdk.util.URLUtils.serializeParameters(URLUtils.java:101)
at com.microsoft.aad.adal4j.AdalTokenRequest.toOAuthRequest(AdalTokenRequest.java:119)
at com.microsoft.aad.adal4j.AdalTokenRequest.executeOAuthRequestAndProcessResponse(AdalTokenRequest.java:71)
at com.microsoft.aad.adal4j.AuthenticationContext.acquireTokenCommon(AuthenticationContext.java:726)
at com.microsoft.aad.adal4j.AuthenticationContext.access$100(AuthenticationContext.java:61)
at com.microsoft.aad.adal4j.AuthenticationContext$1.call(AuthenticationContext.java:128)
at com.microsoft.aad.adal4j.AuthenticationContext$1.call(AuthenticationContext.java:117)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Comments (6)
-
reporter -
Hi!
What version of the SDK is this?
-
Hi!
What version of the SDK is this?
-
- edited description
-
- changed status to invalid
The issue is likely in the calling method:
com.microsoft.aad.adal4j.AdalTokenRequest.toOAuthRequest(AdalTokenRequest.java:119)
Please check with ADAL4j.
-
As documented on ADAL4J -
Also, in URLUtils.java, serializeParameters is expecting MAP < String, LIST<String>> … same has been passed by AdalTokenRequest.
public static String serializeParameters(final Map<String,List<String>> params)
params is of MAP<String, LIST<String>> … but in src/main/java/com/nimbusds/oauth2/sdk/util/URLUtils.java,
at line 101 - entry.getValue is assigned to “String” type… but Value in MAP is a LIST type… Please check.
for (String value: entry.getValue()) {
- Log in to comment
i am trying to get an access token and attach it to a http request . It works fine in a normal java environment but when i try to deploy in another tool called activiti i am thrown with this issue .