Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,295,689
Community Members
 
Community Events
165
Community Groups

Connection to ActiveDirectory with script console

Edited

Hi,

We are trying to connect to our AD forest from the script console, to ultimately able to use the same code with Behaviors or a scripted field. 

Anyway, we want to avoid copying Jars and the like, and we use groovyldap in the console, like this:

@GrabResolver(name='apache-snapshot', root='https://repository.apache.org/snapshots/')
@Grab(group='org.apache.directory', module='groovyldap', version='0.1-SNAPSHOT')

import org.apache.directory.groovyldap.LDAP

def lda_server = 'ldap://xxx.xxxx.net:389/DC=xx,DC=xx,DC=xx'
def ldap_user = 'xxx'
def ldap_password = 'xxxxxx'
def ldap = LDAP.newInstance(lda_server, ldap_user, ldap_password)
def result = ldap.searchUnique("cn=xxxx");
ldap.eachEntry ('(&(OU=xxxx,OU=xxxx))') { person ->
println "${person.displayName} (${person.cn})"
}

But sadly, we get an error 52e, and according to Atlassian doc, it means invalid credentials. But those credentials are valid when I query AD with ADBrowser.

groovyldap don't specify which auth mechanism it use, so maybe it`s using something else than simple? When using JNDI instead of grooyldap, we get this error:



javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.naming.java.javaURLContextFactory Root exception is java.lang.ClassNotFoundException: org.apache.naming.java.javaURLContextFactory
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)

Jira Server 7.11.

1 answer

0 votes

Pascal were you ever able to figure this out? Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

14,479 views 37 44
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you