Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8587783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:39:06+00:00 2026-06-11T22:39:06+00:00

I need some help concerning UnboundID. I heard it was a great choice but

  • 0

I need some help concerning UnboundID. I heard it was a great choice but I’m not really used to it.

So I need to make a LDAP listener. On this listener, i should be able to catch bind request (from a ldap browser for example). I wonder how to get the DN and the password. Here is my code for the LDAP listener:

    public ResultCode CreateLdapServer () throws LDAPException {
       CannedResponseRequestHandler requestHandler = new CannedResponseRequestHandler();
    LDAPListenerConfig config =
             new LDAPListenerConfig(4243, requestHandler);
      try
      {
        config.setListenAddress(
             InetAddress.getByName("localhost"));
      }
      catch (final Exception e)
      {
        System.err.println("Unable to create the listen server.");
        return ResultCode.PARAM_ERROR;
      }

    listener = new LDAPListener(config);

    try
    {
      listener.startListening();
      System.out.println("Serveur is listening ...");
    }
    catch (final Exception e)
    {
        System.err.println("Unable to start listening.");
      return ResultCode.LOCAL_ERROR;
    }
    return ResultCode.SUCCESS;
}

public static void main(String[] args) throws LDAPException {
    MyConnection connect = new MyConnection();
    connect.CreateLdapServer();
}

I read a lot of UnboundID documentation, but i can’t find any simple example of what I need.

Also, i’m not really sure of the utility of CannedResponseRequestHandler. For what i need, is it enough ?

An other question: I’m not sure, but I have the feeling that my server is not listening OR i don’t catch anything (when I connect with a ldap Browser, nothing happened). Any Idea / Suggestion ?

Thanks and have a nice day !

EDIT : Thanks to xhochy, I was able to catch the password and the username. As he said, I subclassed LDAPListenerRequestyHandler to override, first, newInstance then ProcessBindRequest. Here is the code (it’s absolutely not perfect and it’s still a beginning).

public class MyConnection {

private LDAPListener listener;

public MyConnection(){
}

public ResultCode CreateLdapServer() throws LDAPException {
    MyLDAPListenerRequestHandler requestHandler = new MyLDAPListenerRequestHandler();
    LDAPListenerConfig config =
             new LDAPListenerConfig(4243, requestHandler);
      try
      {
        config.setListenAddress(
             InetAddress.getByName("localhost"));
      }
      catch (final Exception e)
      {
        System.err.println("Unable to create the listen server.");
        return ResultCode.PARAM_ERROR;
      }

    listener = new LDAPListener(config);

    try
    {
      listener.startListening();
      System.out.println("Serveur is listening ...");
    }
    catch (IOException e)
    {
        System.err.println("Unable to start listening.");
      return ResultCode.LOCAL_ERROR;
    }


    return ResultCode.SUCCESS;
}

public static void main(String[] args) throws LDAPException {
    MyConnection connect = new MyConnection();
    connect.CreateLdapServer();
}

}

Then the subclass of LDAPListenerRequestHandler:

public class MyLDAPListenerRequestHandler extends LDAPListenerRequestHandler {

@Override
public LDAPListenerRequestHandler newInstance(
        LDAPListenerClientConnection arg0) throws LDAPException {
        System.out.println("New Instance.");
        LDAPConnectionOptions option = new LDAPConnectionOptions();
        LDAPConnection connection = new LDAPConnection(option, "yourIPadress", yourport);
        System.out.println("Connected to : " + connection.getConnectedAddress()+ " " + connection.getConnectedPort());

    return this;
}

@Override
public LDAPMessage processBindRequest(int arg0, BindRequestProtocolOp arg1,
        List<Control> arg2) {
    System.out.println(arg1.getBindDN());
    System.out.println(arg1.getSimplePassword());
    return null;
}

}

Thanks again !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:39:07+00:00Added an answer on June 11, 2026 at 10:39 pm

    You should subclass LDAPListenerRequestHandler and implement processBindRequest. All the information you are looking for is included in BindRequestProtocolOp (second argument of processBindRequest). Add an empty implementation for all other abstract methods.

    If request is your BindRequestProtocolOp instance then you get your information via:

    String username = request.getBindDN();
    ByteString password = request.getSimplePassword();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help concerning deadlocks. I just do not understand why my code
I really need some help on an issue: I'm converting an XML to CSV
I really need some help on an issue: I'm converting an XML to CSV
I need some help concerning nested attributes in models with 'has_one' relationship. Model Survey
I need some help converting decimal to hex with NO functions on python. I'm
Need some help... I have jasperserver 4.1 installed on my ubuntu. It runs via
Need some help with Activerecord Querying in a has_many :through association. Model: Job class
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some help to solve this. I have a gridview and inside the gridview
Need some help with this problem in implementing with XSLT, I had already implemented

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.