Getting exception while updating user groups from SSL enabled AD directory


I am trying to update the groups of the User from connected AD Directory(with SSL) and I getting the ClassNotFoundException.

Here is the snapshot of the code:-

UserAccessor userAccessor = (UserAccessor) ContainerManager.getComponent(“userAccessor”);
userAccessor.addMembership(group, user);


com.atlassian.confluence.user.UserManagementOperationFailedException: java.lang.ClassNotFoundException: not found by com.demoproject.sso.saml.confluence-sso [272]
at com.atlassian.confluence.user.DefaultUserAccessor.addMembership(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(

Did you ever find a solution for this? I’m having the same problem and can’t seem to find much about it.

You need to set LdapHostnameVerificationSSLSocketFactory class in the current thread and Confluence Sysadmin user in the AuthenticatedUserThreadLocal (for permission to update user).

Try this code

Thread currentThread = Thread.currentThread();
ClassLoader classLoader= currentThread.getContextClassLoader();
AuthenticatedUserThreadLocal.set(“Confluence Sys admin username”);
userAccessor.addMembership(“group_name”, “username”);

1 Like

Thanks Lokesh for your solution. :grinning:
I also shared the link of this page to JRASERVER-42868