-
Notifications
You must be signed in to change notification settings - Fork 81
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
In order to perform this operation a successful bind must be completed on the connection #142
Comments
There's not really any actual question here, but I assume that you're encountering this error and would like to know why. First, that error is coming from the directory server (Active Directory by the looks of it), and not from the LDAP SDK itself. Second, unlike many messages from Active Directory, this one is actually pretty clear. As the message states, the client needs to send a bind request to authenticate the connection before it will allow the operation you've requested. |
Can you please guide me on how I can perform a bind request to authenticate the connection? |
Use the LDAPConnection.bind method to submit an appropriate bind request. The easiest and most common type of bind is an LDAP simple bind, which authenticates with the DN and password for the user as whom you're trying to authenticate. If you don't have the DN and password for a user account, then you'll need to talk to a server administrator. Also, binds are one of the most fundamental concepts in LDAP. If you don't really understand them, then you should probably spend some time learning more about LDAP before proceeding. |
I am using this in my code. Is this what you are suggesting to use? |
That call will perform a bind on a connection from the connection pool, but the problem is that if you subsequently try to perform another operation that requires a previous bind, if your connection pool has more than one connection, then there's no guarantee that it will choose the same connection for the bind as another operation that follows it. If you want to use the same credentials for all operations processed in the connection pool, then the best option would be to provide the credentials at the time you create the connection pool. The way that you do this depends on how you're creating the pool.
On the other hand, if you want most connections in the pool to either be unauthenticated, or authenticated as a different user, then you have a couple of options. But if the bind should just be considered temporary, then you'll probably need to check a connection out of the pool using the getConnection method, use that connection to perform the bind and the subsequent operations that need to be authenticated as that user, then return the connection back to the pool using the releaseAndReAuthenticateConnection method. The releaseAndReAuthenticateConnection method will attempt to revert the connection back to the authentication state it had when the connection was initially established by the pool (and if it was initially unauthenticated, then the pool will use an anonymous simple bind to try to achieve that). |
000004DC: LdapErr: DSID-0C090A5A, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v4f7c
The text was updated successfully, but these errors were encountered: