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;
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
add a comment |
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
add a comment |
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
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
ldap ldap-query unboundid-ldap-sdk
asked Mar 22 at 12:41
jose azevedojose azevedo
598
598
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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