Seach for a specific entry in ldap Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!How to show all objectclasses description of ldap directory using jndiHow to sort LDAP Result with LDAP Query?What are CN, OU, DC in an LDAP search?Unboundid LDAP vs Netscape LDAP performence gapApplying filter to Ldap search also sorts the resultsLdap search with negative parameterAdd entry in openldap server using unboundid ldap sdkUnboundID LDAP memberof-overlayHow to add an attribute to an LDAP schemaLDAP: Retrieve entries from multiple OUs in one query

Table formatting with tabularx?

What is a more techy Technical Writer job title that isn't cutesy or confusing?

Marquee sign letters

Was the pager message from Nick Fury to Captain Marvel unnecessary?

Why not use the yoke to control yaw, as well as pitch and roll?

Pointing to problems without suggesting solutions

How can I prevent/balance waiting and turtling as a response to cooldown mechanics

As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?

Why are current probes so expensive?

Does the universe have a fixed centre of mass?

Is a copyright notice with a non-existent name be invalid?

Problem with display of presentation

How to resize main filesystem

Why can't fire hurt Daenerys but it did to Jon Snow in season 1?

How can I list files in reverse time order by a command and pass them as arguments to another command?

Can two people see the same photon?

Inverse square law not accurate for non-point masses?

How to make an animal which can only breed for a certain number of generations?

New Order #6: Easter Egg

3D Masyu - A Die

Is the time—manner—place ordering of adverbials an oversimplification?

Did pre-Columbian Americans know the spherical shape of the Earth?

Vertical ranges of Column Plots in 12

Understanding piped commands in GNU/Linux



Seach for a specific entry in ldap



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!How to show all objectclasses description of ldap directory using jndiHow to sort LDAP Result with LDAP Query?What are CN, OU, DC in an LDAP search?Unboundid LDAP vs Netscape LDAP performence gapApplying filter to Ldap search also sorts the resultsLdap search with negative parameterAdd entry in openldap server using unboundid ldap sdkUnboundID LDAP memberof-overlayHow to add an attribute to an LDAP schemaLDAP: Retrieve entries from multiple OUs in one query



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am trying to search an entry on ldap based on the name of the same entry.



The seach entries that i am getting are similar to this one:



CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2


What i want to do is filter my search to just show the entry with that name because currently i´m getting all of the entries:



SearchRequest searchRequest = new SearchRequest(ldapConfig.getBaseDn(), SearchScope.SUB,
Filter.createEqualityFilter("objectClass", "person"));


I'm using ldap unboundid with springboot.










share|improve this question




























    0















    I am trying to search an entry on ldap based on the name of the same entry.



    The seach entries that i am getting are similar to this one:



    CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2


    What i want to do is filter my search to just show the entry with that name because currently i´m getting all of the entries:



    SearchRequest searchRequest = new SearchRequest(ldapConfig.getBaseDn(), SearchScope.SUB,
    Filter.createEqualityFilter("objectClass", "person"));


    I'm using ldap unboundid with springboot.










    share|improve this question
























      0












      0








      0








      I am trying to search an entry on ldap based on the name of the same entry.



      The seach entries that i am getting are similar to this one:



      CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2


      What i want to do is filter my search to just show the entry with that name because currently i´m getting all of the entries:



      SearchRequest searchRequest = new SearchRequest(ldapConfig.getBaseDn(), SearchScope.SUB,
      Filter.createEqualityFilter("objectClass", "person"));


      I'm using ldap unboundid with springboot.










      share|improve this question














      I am trying to search an entry on ldap based on the name of the same entry.



      The seach entries that i am getting are similar to this one:



      CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2


      What i want to do is filter my search to just show the entry with that name because currently i´m getting all of the entries:



      SearchRequest searchRequest = new SearchRequest(ldapConfig.getBaseDn(), SearchScope.SUB,
      Filter.createEqualityFilter("objectClass", "person"));


      I'm using ldap unboundid with springboot.







      ldap ldap-query unboundid-ldap-sdk






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 22 at 12:41









      jose azevedojose azevedo

      598




      598






















          1 Answer
          1






          active

          oldest

          votes


















          1














          To find "CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2" or any entry you know the DN is correct, you need something like:



          SearchRequest searchRequest = new SearchRequest("CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2", SearchScope.BASE, Filter.createEqualityFilter("objectClass", "person"));


          You should also consider a READ similar to:



          LDAPConnection.read("CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2",
          java.lang.String[], LDAPSearchConstraints)


          If you need to find the entry, then a search request similar to:



          Filter andFilter = new Filter.createANDFilter(
          Filter.createEqualityFilter("objectClass", "person"),
          Filter.createEqualityFilter("cn", "nameOfTheUser"));

          SearchRequest searchRequest = new SearchRequest("new SearchRequest(ldapConfig.getBaseDn()", SearchScope.BASE, andFilter);


          -jim






          share|improve this answer

























          • But can i find the entry just with the nameOfTheUser?

            – jose azevedo
            Mar 22 at 13:57












          • Updated answer based on clarification.

            – jwilleke
            Mar 23 at 9:40











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55299848%2fseach-for-a-specific-entry-in-ldap%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          To find "CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2" or any entry you know the DN is correct, you need something like:



          SearchRequest searchRequest = new SearchRequest("CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2", SearchScope.BASE, Filter.createEqualityFilter("objectClass", "person"));


          You should also consider a READ similar to:



          LDAPConnection.read("CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2",
          java.lang.String[], LDAPSearchConstraints)


          If you need to find the entry, then a search request similar to:



          Filter andFilter = new Filter.createANDFilter(
          Filter.createEqualityFilter("objectClass", "person"),
          Filter.createEqualityFilter("cn", "nameOfTheUser"));

          SearchRequest searchRequest = new SearchRequest("new SearchRequest(ldapConfig.getBaseDn()", SearchScope.BASE, andFilter);


          -jim






          share|improve this answer

























          • But can i find the entry just with the nameOfTheUser?

            – jose azevedo
            Mar 22 at 13:57












          • Updated answer based on clarification.

            – jwilleke
            Mar 23 at 9:40















          1














          To find "CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2" or any entry you know the DN is correct, you need something like:



          SearchRequest searchRequest = new SearchRequest("CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2", SearchScope.BASE, Filter.createEqualityFilter("objectClass", "person"));


          You should also consider a READ similar to:



          LDAPConnection.read("CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2",
          java.lang.String[], LDAPSearchConstraints)


          If you need to find the entry, then a search request similar to:



          Filter andFilter = new Filter.createANDFilter(
          Filter.createEqualityFilter("objectClass", "person"),
          Filter.createEqualityFilter("cn", "nameOfTheUser"));

          SearchRequest searchRequest = new SearchRequest("new SearchRequest(ldapConfig.getBaseDn()", SearchScope.BASE, andFilter);


          -jim






          share|improve this answer

























          • But can i find the entry just with the nameOfTheUser?

            – jose azevedo
            Mar 22 at 13:57












          • Updated answer based on clarification.

            – jwilleke
            Mar 23 at 9:40













          1












          1








          1







          To find "CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2" or any entry you know the DN is correct, you need something like:



          SearchRequest searchRequest = new SearchRequest("CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2", SearchScope.BASE, Filter.createEqualityFilter("objectClass", "person"));


          You should also consider a READ similar to:



          LDAPConnection.read("CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2",
          java.lang.String[], LDAPSearchConstraints)


          If you need to find the entry, then a search request similar to:



          Filter andFilter = new Filter.createANDFilter(
          Filter.createEqualityFilter("objectClass", "person"),
          Filter.createEqualityFilter("cn", "nameOfTheUser"));

          SearchRequest searchRequest = new SearchRequest("new SearchRequest(ldapConfig.getBaseDn()", SearchScope.BASE, andFilter);


          -jim






          share|improve this answer















          To find "CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2" or any entry you know the DN is correct, you need something like:



          SearchRequest searchRequest = new SearchRequest("CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2", SearchScope.BASE, Filter.createEqualityFilter("objectClass", "person"));


          You should also consider a READ similar to:



          LDAPConnection.read("CN=nameOfTheUser,OU=firstGroupName,...,DC=domain1,DC=domain2",
          java.lang.String[], LDAPSearchConstraints)


          If you need to find the entry, then a search request similar to:



          Filter andFilter = new Filter.createANDFilter(
          Filter.createEqualityFilter("objectClass", "person"),
          Filter.createEqualityFilter("cn", "nameOfTheUser"));

          SearchRequest searchRequest = new SearchRequest("new SearchRequest(ldapConfig.getBaseDn()", SearchScope.BASE, andFilter);


          -jim







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 23 at 9:39

























          answered Mar 22 at 13:18









          jwillekejwilleke

          7,05811534




          7,05811534












          • But can i find the entry just with the nameOfTheUser?

            – jose azevedo
            Mar 22 at 13:57












          • Updated answer based on clarification.

            – jwilleke
            Mar 23 at 9:40

















          • But can i find the entry just with the nameOfTheUser?

            – jose azevedo
            Mar 22 at 13:57












          • Updated answer based on clarification.

            – jwilleke
            Mar 23 at 9:40
















          But can i find the entry just with the nameOfTheUser?

          – jose azevedo
          Mar 22 at 13:57






          But can i find the entry just with the nameOfTheUser?

          – jose azevedo
          Mar 22 at 13:57














          Updated answer based on clarification.

          – jwilleke
          Mar 23 at 9:40





          Updated answer based on clarification.

          – jwilleke
          Mar 23 at 9:40



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55299848%2fseach-for-a-specific-entry-in-ldap%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript