You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by "Robinson, James F" <ja...@uiowa.edu> on 2018/09/26 20:50:30 UTC

LdifAnonymizer: No file to anonymize... when using client API?

I'm a newcomer to LDAP trying to assemble what should be a very simple tool: take a user name, attempt to connect to an Active Directory server and bind on UID only, so that it pops a password dialog, so that I can authenticate the user of a particular application. I don't need anything more advanced than "is this a valid DN, and if it is can you ask them for a password and let me know if it's valid?"

My code, trivial as it is, is failing to even launch, because LdifAnonymizer throws an exception that there's "No file to anonymize." Poking through the source, ldap.client.api.LdifAnonymizer appears to do this when launched as a standalone application without a file being passed in as a parameter. But I'm not trying to launch anything, so I'm not sure what is, or why. I have the following libraries added to Eclipse as "Referenced libraries:"

                api-asn1-api-2.0.0.AM2.jar
                api-asn1-ber-2.0.0.AM2.jar
                api-ldap-client-api-2.0.0.AM2.jar
                api-ldap-codec-core-2.0.0.AM2.jar
                api-ldap-model-2.0.0.AM2.jar
                mina-core-2.0.18.jar
                slf4j-api-1.7.25.jar

This is the minimum set of libraries necessary to resolve all dependencies generated by api-ldap-client-api-2.0.0.AM2.jar. I haven't touched any configuration files. Everything's as it was downloaded. I'm obviously doing something wrong, but from both the "Five Minutes[sic] Tutorial" (should be "Minute," singular-English is funny that way) and what I can find in the User Manual, the client should act like a client, not attempt to install or run any services. Yet the User Manual only mentions Ldif in terms of adding records to a DS server, and I have no interest at all in doing that. I just want to connect and bind to a remote AD server, get my yes/no authentication result, and unbind.

Am I using the wrong tool? Missing something obvious? I'm at my wit's end here. I'd provide code, but this error happens even if I comment out the import directive that brings in org.apache.directory.ldap.client.api.LdapNetworkConnection. It appears to be enough to link the JAR, and I get the error.

Thanks,

--
James Robinson, Application Developer
State Health Registry of Iowa
2600 UCC | james-robinson@uiowa.edu<ma...@uiowa.edu> | (319) 335-6619



Re: LdifAnonymizer: No file to anonymize... when using client API?

Posted by Emmanuel Lécharny <el...@gmail.com>.
Hi,


Le 26/09/2018 à 22:50, Robinson, James F a écrit :
> I'm a newcomer to LDAP trying to assemble what should be a very simple tool: take a user name, attempt to connect to an Active Directory server and bind on UID only, so that it pops a password dialog, so that I can authenticate the user of a particular application. I don't need anything more advanced than "is this a valid DN, and if it is can you ask them for a password and let me know if it's valid?"

> 
> My code, trivial as it is, is failing to even launch, because LdifAnonymizer throws an exception that there's "No file to anonymize." Poking through the source, ldap.client.api.LdifAnonymizer appears to do this when launched as a standalone application without a file being passed in as a parameter. But I'm not trying to launch anything, so I'm not sure what is, or why. I have the following libraries added to Eclipse as "Referenced libraries:"
> 
>                 api-asn1-api-2.0.0.AM2.jar
>                 api-asn1-ber-2.0.0.AM2.jar
>                 api-ldap-client-api-2.0.0.AM2.jar
>                 api-ldap-codec-core-2.0.0.AM2.jar
>                 api-ldap-model-2.0.0.AM2.jar
>                 mina-core-2.0.18.jar
>                 slf4j-api-1.7.25.jar
> 
> This is the minimum set of libraries necessary to resolve all dependencies generated by api-ldap-client-api-2.0.0.AM2.jar. 

You can also use api-all.jar which contains what is needed in one single
package.

I don't know what is your code, I can't tell what is going wrong, except
that the LddifAnonymizer.main() function is getting called. If you are
running your code in eclipse, make sure that the right main() method is
selected (Eclipse can pick one for you, and this is the only one present
in the LDAP API).

I haven't touched any configuration files. Everything's as it was
downloaded. I'm obviously doing something wrong, but from both the "Five
Minutes[sic] Tutorial" (should be "Minute," singular-English is funny
that way) and what I can find in the User Manual, the client should act
like a client, not attempt to install or run any services. Yet the User
Manual only mentions Ldif in terms of adding records to a DS server, and
I have no interest at all in doing that. I just want to connect and bind
to a remote AD server, get my yes/no authentication result, and unbind.

It should work, if you launch your app and if your app has a main().

PS: I have fixed the 'Five Minute(s)' thing

-- 
Emmanuel Lecharny

Symas.com
directory.apache.org