Package netscape.ldap
Class LDAPSaslBind
java.lang.Object
netscape.ldap.LDAPSaslBind
- All Implemented Interfaces:
Serializable
,LDAPBind
Authenticates to a server using SASL
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
bind
(LDAPConnection ldc) Authenticates to the LDAP server (that the object is currently connected to) using the parameter that were provided to the constructor.(package private) void
bind
(LDAPConnection ldc, boolean rebind) private boolean
checkForSASLBindCompletion
(int resultCode) private Object
getClient
(LDAPConnection ldc, String packageName) Get a SaslClient object from the Sasl framework(package private) boolean
isExternalMechanism
(String name) private JDAPBindResponse
saslBind
(LDAPConnection ldc, String mechanismName, byte[] credentials)
-
Field Details
-
serialVersionUID
static final long serialVersionUID- See Also:
-
CALLBACK_HANDLER
- See Also:
-
CLIENTPKGS
- See Also:
-
_dn
-
_mechanisms
-
_packageName
-
_props
-
_cbh
-
_saslClient
-
-
Constructor Details
-
LDAPSaslBind
public LDAPSaslBind(String dn, String[] mechanisms, String packageName, Hashtable<Object, Object> props, Object cbh) Construct an object which can authenticate to an LDAP server using the specified name and a specified SASL mechanism.- Parameters:
dn
- if non-null and non-empty, specifies that the connection and all operations through it should authenticate with dn as the distinguished namemechanisms
- array of mechanism names, e.g. { "GSSAPI", "SKEY" }props
- optional additional properties of the desired authentication mechanism, e.g. minimum security levelcbh
- a class which may be called by the SASL framework to obtain additional required information
-
-
Method Details
-
bind
Authenticates to the LDAP server (that the object is currently connected to) using the parameter that were provided to the constructor. If the requested SASL mechanism is not available, an exception is thrown. If the object has been disconnected from an LDAP server, this method attempts to reconnect to the server. If the object had already authenticated, the old authentication is discarded.- Specified by:
bind
in interfaceLDAPBind
- Parameters:
ldc
- an active connection to a server, which will have the new authentication state on return from the method- Throws:
LDAPException
- Failed to authenticate to the LDAP server.- See Also:
-
getClient
Get a SaslClient object from the Sasl framework- Parameters:
ldc
- contains the host namepackageName
- package containing a ClientFactory- Returns:
- a SaslClient supporting one of the mechanisms of the member variable _mechanisms.
- Throws:
LDAPException
- on error producing a client
-
bind
- Throws:
LDAPException
-
isExternalMechanism
-
checkForSASLBindCompletion
- Throws:
LDAPException
-
saslBind
private JDAPBindResponse saslBind(LDAPConnection ldc, String mechanismName, byte[] credentials) throws LDAPException - Throws:
LDAPException
-