Login exception java.lang.ClassCastException: java.lang.String cannot be cast to [C

Description

When setting up AD with a service user account configured, we get this Exception:

1 2 3 4 2018-06-13 10:56:50 ERROR http-nio-8420-exec-9:AbstractLoginModule:93 - Login exception java.lang.ClassCastException: java.lang.String cannot be cast to [C at org.springframework.security.ldap.authentication.ad.ActiveDirectoryAuthenticationProvider.authenticate(ActiveDirectoryAuthenticationProvider.java:153) at com.thinkbiganalytics.security.auth.ad.ActiveDirectoryLoginModule.doLogin(ActiveDirectoryLoginModule.java:93)

Which seems to come from this line of code:

1 String credentials = String.valueOf((char[]) authToken.getCredentials());

So seems like casting is getting messed up as it's already been received as a String that can't be casted to char[]

Environment

None

Status

Assignee

Unassigned

Reporter

Alberto Rodriguez

Labels

None

Reviewer

None

Story point estimate

None

Components

Affects versions

0.9.0.2

Priority

Medium
Configure