Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to search entry by operational attribute (PrimaryGroupToken)? #152

Open
gredwhite opened this issue Aug 23, 2023 · 2 comments
Open

How to search entry by operational attribute (PrimaryGroupToken)? #152

gredwhite opened this issue Aug 23, 2023 · 2 comments

Comments

@gredwhite
Copy link

I have following snippet

val entry = ldapConnectionPool.getEntry(groupNn, SearchRequest.ALL_USER_ATTRIBUTES, "PrimaryGroupToken")
val primaryGroupToken = entry.getAttributeValue("PrimaryGroupToken")

primaryGroupToken equals 550 after execution

Then I want to find the same entry by PrimaryGroupToken

ldapConnectionPool.searchForEntry(SearchRequest(dn, SearchScope.SUB, "PrimaryGroupToken=$primaryGroupToken"))

but it returns null. Is there way to find entry by PrimaryGroupToken ?

@dirmgr
Copy link
Collaborator

dirmgr commented Aug 23, 2023

If the searchForEntry method is returning null, then that means that the search succeeded, but didn't return any entries. The most likely reason for that is:

  • The search request that you're issuing doesn't match any entries.
  • The search request does match one or more entries, but the requester doesn't have permission to retrieve them, so the server omits them from the results.

While I suppose that it's not out of the realm of possibility that the LDAP SDK is sending a request that is somehow different from what you intended, or that it's somehow mishandling the results, I think that it's overwhelmingly unlikely that this is a problem with the LDAP SDK, and instead is an issue with the search that you're performing. Unless you have reason to suspect a problem in the LDAP SDK, questions like this are much more appropriate for Microsoft, who make Active Directory and are much more familiar with its behaviors and eccentricities, than it is for a forum that is specific to the UnboundID LDAP SDK for Java.

@gredwhite
Copy link
Author

If the searchForEntry method is returning null, then that means that the search succeeded, but didn't return any entries. The most likely reason for that is:

  • The search request that you're issuing doesn't match any entries.
  • The search request does match one or more entries, but the requester doesn't have permission to retrieve them, so the server omits them from the results.

While I suppose that it's not out of the realm of possibility that the LDAP SDK is sending a request that is somehow different from what you intended, or that it's somehow mishandling the results, I think that it's overwhelmingly unlikely that this is a problem with the LDAP SDK, and instead is an issue with the search that you're performing. Unless you have reason to suspect a problem in the LDAP SDK, questions like this are much more appropriate for Microsoft, who make Active Directory and are much more familiar with its behaviors and eccentricities, than it is for a forum that is specific to the UnboundID LDAP SDK for Java.

Thank you foe your response. Could you give me a hint what is more suitable place for such questions ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants