Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ClassNotFound on LoginManage.authenticate with LDAPS

Mario Anstoots
May 20, 2020

Hi,

we are using the function authenticate(User,password) from the LoginManager(com.atlassian.jira.security.login.LoginManager), to verify username and password entered on the login form.

When using a ActiveDirectory with SSL (LDAPS) there is an error on this function:

[INFO] [talledLocalContainer] com.atlassian.crowd.exception.runtime.OperationFailedException
[INFO] [talledLocalContainer] at com.atlassian.crowd.embedded.core.CrowdServiceImpl.convertOperationFailedException(CrowdServiceImpl.java:676)
[INFO] [talledLocalContainer] at com.atlassian.crowd.embedded.core.CrowdServiceImpl.authenticate(CrowdServiceImpl.java:76)
[INFO] [talledLocalContainer] at com.atlassian.jira.security.login.LoginManagerImpl$InternalStaticDependencies.authenticate(LoginManagerImpl.java:384)
[INFO] [talledLocalContainer] at com.atlassian.jira.security.login.LoginManagerImpl.authenticate(LoginManagerImpl.java:184)
[INFO] [talledLocalContainer] at com.secsign.jira.servlet.filter.SecSignIDPasswordLoginFilter.checkLogin(SecSignIDPasswordLoginFilter.java:128)

[...]

[INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:748)
[INFO] [talledLocalContainer] Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not create DirContext instance for transaction; nested exception is org.springframework.ldap.CommunicationException: [ADURL]; nested exception is javax.naming.CommunicationException: [ADURL] [Root exception is java.lang.ClassNotFoundException: com.atlassian.crowd.directory.ssl.LdapHostnameVerificationSSLSocketFactory not found by com.secsign.secsignid [232]]
[INFO] [talledLocalContainer] at org.springframework.transaction.compensating.support.AbstractCompensatingTransactionManagerDelegate.doBegin(AbstractCompensatingTransactionManagerDelegate.java:90)
[INFO] [talledLocalContainer] at org.springframework.ldap.transaction.compensating.manager.ContextSourceTransactionManager.doBegin(ContextSourceTransactionManager.java:123)
[INFO] [talledLocalContainer] at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:378)
[INFO] [talledLocalContainer] at com.atlassian.crowd.directory.SpringLDAPConnector.pageSearchResults(SpringLDAPConnector.java:345)
[INFO] [talledLocalContainer] at com.atlassian.crowd.directory.SpringLDAPConnector.searchEntitiesWithRequestControls(SpringLDAPConnector.java:431)
[INFO] [talledLocalContainer] at com.atlassian.crowd.directory.SpringLDAPConnector.searchEntities(SpringLDAPConnector.java:415)
[INFO] [talledLocalContainer] at com.atlassian.crowd.directory.SpringLDAPConnector.searchUserObjects(SpringLDAPConnector.java:603)
[INFO] [talledLocalContainer] at com.atlassian.crowd.directory.SpringLDAPConnector.findUserWithAttributesByName(SpringLDAPConnector.java:559)
[INFO] [talledLocalContainer] at com.atlassian.crowd.directory.SpringLDAPConnector.findUserByName(SpringLDAPConnector.java:546)
[INFO] [talledLocalContainer] at com.atlassian.crowd.directory.SpringLDAPConnector.authenticate(SpringLDAPConnector.java:960)
[INFO] [talledLocalContainer] at com.atlassian.crowd.directory.DbCachingRemoteDirectory.authenticateAndUpdateInternalUser(DbCachingRemoteDirectory.java:246)
[INFO] [talledLocalContainer] at com.atlassian.crowd.directory.DbCachingRemoteDirectory.performAuthenticationAndUpdateAttributes(DbCachingRemoteDirectory.java:186)
[INFO] [talledLocalContainer] at com.atlassian.crowd.directory.DbCachingRemoteDirectory.authenticate(DbCachingRemoteDirectory.java:166)
[INFO] [talledLocalContainer] at com.atlassian.crowd.manager.directory.DirectoryManagerGeneric.authenticateUser(DirectoryManagerGeneric.java:273)
[INFO] [talledLocalContainer] at com.atlassian.crowd.manager.application.ApplicationServiceGeneric.authenticateUser(ApplicationServiceGeneric.java:181)
[INFO] [talledLocalContainer] at com.atlassian.crowd.embedded.core.CrowdServiceImpl.authenticate(CrowdServiceImpl.java:70)
[INFO] [talledLocalContainer] ... 264 more
[INFO] [talledLocalContainer] Caused by: org.springframework.ldap.CommunicationException: [ADURL]; nested exception is javax.naming.CommunicationException: [ADURL] [Root exception is java.lang.ClassNotFoundException: com.atlassian.crowd.directory.ssl.LdapHostnameVerificationSSLSocketFactory not found by com.secsign.secsignid [232]]
[INFO] [talledLocalContainer] at org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:108)
[INFO] [talledLocalContainer] at org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:355)
[INFO] [talledLocalContainer] at org.springframework.ldap.core.support.AbstractContextSource.doGetContext(AbstractContextSource.java:139)
[INFO] [talledLocalContainer] at org.springframework.ldap.core.support.AbstractContextSource.getReadWriteContext(AbstractContextSource.java:174)
[INFO] [talledLocalContainer] at org.springframework.ldap.transaction.compensating.manager.ContextSourceTransactionManagerDelegate.getNewHolder(ContextSourceTransactionManagerDelegate.java:96)
[INFO] [talledLocalContainer] at org.springframework.transaction.compensating.support.AbstractCompensatingTransactionManagerDelegate.doBegin(AbstractCompensatingTransactionManagerDelegate.java:83)
[INFO] [talledLocalContainer] ... 279 more
[INFO] [talledLocalContainer] Caused by: javax.naming.CommunicationException: [ADURL] [Root exception is java.lang.ClassNotFoundException: com.atlassian.crowd.directory.ssl.LdapHostnameVerificationSSLSocketFactory not found by com.secsign.secsignid [232]]
[INFO] [talledLocalContainer] at com.sun.jndi.ldap.Connection.<init>(Connection.java:238)
[INFO] [talledLocalContainer] at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:137)
[INFO] [talledLocalContainer] at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1615)
[INFO] [talledLocalContainer] at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2749)
[INFO] [talledLocalContainer] at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:319)
[INFO] [talledLocalContainer] at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:192)
[INFO] [talledLocalContainer] at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:210)
[INFO] [talledLocalContainer] at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:153)
[INFO] [talledLocalContainer] at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:83)
[INFO] [talledLocalContainer] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
[INFO] [talledLocalContainer] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
[INFO] [talledLocalContainer] at javax.naming.InitialContext.init(InitialContext.java:244)
[INFO] [talledLocalContainer] at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:154)
[INFO] [talledLocalContainer] at org.springframework.ldap.core.support.LdapContextSource.getDirContextInstance(LdapContextSource.java:42)
[INFO] [talledLocalContainer] at org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:343)
[INFO] [talledLocalContainer] ... 283 more
[INFO] [talledLocalContainer] Caused by: java.lang.ClassNotFoundException: com.atlassian.crowd.directory.ssl.LdapHostnameVerificationSSLSocketFactory not found by com.secsign.secsignid [232]
[INFO] [talledLocalContainer] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639)
[INFO] [talledLocalContainer] at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
[INFO] [talledLocalContainer] at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
[INFO] [talledLocalContainer] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[INFO] [talledLocalContainer] at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1927)
[INFO] [talledLocalContainer] at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:978)
[INFO] [talledLocalContainer] at com.atlassian.plugin.osgi.util.BundleClassLoaderAccessor$BundleClassLoader.findClass(BundleClassLoaderAccessor.java:64)
[INFO] [talledLocalContainer] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[INFO] [talledLocalContainer] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[INFO] [talledLocalContainer] at java.lang.Class.forName0(Native Method)
[INFO] [talledLocalContainer] at java.lang.Class.forName(Class.java:348)
[INFO] [talledLocalContainer] at com.sun.jndi.ldap.VersionHelper12.loadClass(VersionHelper12.java:72)
[INFO] [talledLocalContainer] at com.sun.jndi.ldap.Connection.createSocket(Connection.java:293)
[INFO] [talledLocalContainer] at com.sun.jndi.ldap.Connection.<init>(Connection.java:215)
[INFO] [talledLocalContainer] ... 297 more

 


Without LDAPS there is no error and it works like intended.

What is the problem with this function and how to solve it?

 

Kind regards,

Mario Anstoots

 

3 answers

0 votes
MattS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
January 16, 2015

I believe Atlassian recommends using jql rather than SQL, since SQL gives full access to all data in JIRA including restricted issues. And SQL queries are not allowed in Cloud

MattS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
January 16, 2015

For non-cloud script runner is a better approach I think

0 votes
Stephen LaRoche
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 16, 2015

That's awesome!

I should have said JIRA "filter" instead of query.   I was hoping I could do it with JQL.

But I think I just need to ask for db query permission and do this using sql like you proposed.  

I can see from what your sql needs to do that I was just having a nice fantasy that it could be done from advanced search using JQL. smile

João Palharini
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 16, 2015

At this point you cannot achieve this kind of result with a JQL query, as it's very basic, not including advanced functions like 'JOIN'. :( By the way, I made a mistake on the query, which I just corrected. I have updated it and should perform way better! ;)

0 votes
João Palharini
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 16, 2015

Hey Stephen!

Good news for you: the query is not only possible, I also just wrote it for you and you can test just by copying it below and running on your database. wink

warning Be aware that this query was wrote and tested on a PostgreSQL database, so you may have to adapt according to your database type.

SELECT DISTINCT(CONCAT(p.pkey, '-', ji.issuenum)) AS "Issue", 
    ja.created AS "Date of first comment", 
    ja.actionbody AS "Comment" 
FROM jiraaction ja 
    JOIN jiraissue ji ON ja.issueid = ji.id
    JOIN project p ON ji.project = p.id
WHERE actiontype='comment'
    AND ji.reporter != ja.author
ORDER BY 3;

 

Cheers!

Joao

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events