Interface GSSAPISASLBindRequest
- All Superinterfaces:
BindRequest,Request,SASLBindRequest
The optional authorization identity is specified using an authorization ID,
or authzId, as defined in RFC 4513 section 5.2.1.8.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringIndicates that the client will accept authentication only.static final StringIndicates that the client will accept authentication with connection integrity protection and encryption.static final StringIndicates that the client will accept authentication with connection integrity protection.static final StringThe name of the SASL mechanism based on GSS-API authentication.Fields inherited from interface org.forgerock.opendj.ldap.requests.BindRequest
AUTHENTICATION_TYPE_SASL, AUTHENTICATION_TYPE_SIMPLE -
Method Summary
Modifier and TypeMethodDescriptionaddAdditionalAuthParam(String name, String value) Adds the provided additional authentication parameter to the list of parameters to be passed to the underlying mechanism implementation.addControl(Control control) Adds the provided control to this request.Adds the provided quality of protection (QOP) values to the ordered list of QOP values that the client is willing to accept.createBindClient(String serverName) Creates a new bind client which can be used to perform the authentication process.Returns a map containing the provided additional authentication parameters to be passed to the underlying mechanism implementation.Returns the authentication ID of the user, which should be the user's Kerberos principal.byteReturns the authentication mechanism identifier for this SASL bind request as defined by the LDAP protocol, which is always0xA3.Returns the optional authorization ID of the user which represents an alternate authorization identity which should be used for subsequent operations performed on the connection.<C extends Control>
CgetControl(ControlDecoder<C> decoder, DecodeOptions options) Decodes and returns the first control in this request having an OID corresponding to the provided control decoder.Returns aListcontaining the controls included with this request.Returns the optional address of the Kerberos KDC (Key Distribution Center).intReturns the maximum size of the receive buffer in bytes.intReturns the maximum size of the send buffer in bytes.getName()Returns the name of the Directory object that the client wishes to bind as, which is always the empty string for SASL authentication.byte[]Returns the password of the user that the client wishes to bind as.getQOPs()Returns the ordered list of quality of protection (QOP) values that the client is willing to accept.getRealm()Returns the optional realm containing the user's account.Returns the SASL mechanism for this SASL bind request.Returns the Kerberos subject of the user to be authenticated.booleanReturnstrueif the server must authenticate to the client.setAuthenticationID(String authenticationID) Sets the authentication ID of the user, which should be the user's Kerberos principal.setAuthorizationID(String authorizationID) Sets the optional authorization ID of the user which represents an alternate authorization identity which should be used for subsequent operations performed on the connection.setKDCAddress(String address) Sets the optional address of the Kerberos KDC (Key Distribution Center).setMaxReceiveBufferSize(int size) Sets the maximum size of the receive buffer in bytes.setMaxSendBufferSize(int size) Sets the maximum size of the send buffer in bytes.setPassword(byte[] password) Sets the password of the user that the client wishes to bind as.setPassword(char[] password) Sets the password of the user that the client wishes to bind as.Sets the optional realm containing the user's account.setServerAuth(boolean serverAuth) Specifies whether the server must authenticate to the client.setSubject(Subject subject) Sets the Kerberos subject of the user to be authenticated.Methods inherited from interface org.forgerock.opendj.ldap.requests.Request
containsControl
-
Field Details
-
QOP_AUTH
Indicates that the client will accept authentication only. More specifically, the underlying connection will not be protected using integrity protection or encryption, unless previously established using SSL/TLS. This is the default if no QOP option is present in the bind request.- See Also:
-
QOP_AUTH_CONF
Indicates that the client will accept authentication with connection integrity protection and encryption.- See Also:
-
QOP_AUTH_INT
Indicates that the client will accept authentication with connection integrity protection. More specifically, the underlying connection will not be encrypted, unless previously established using SSL/TLS.- See Also:
-
SASL_MECHANISM_NAME
The name of the SASL mechanism based on GSS-API authentication.- See Also:
-
-
Method Details
-
addAdditionalAuthParam
Adds the provided additional authentication parameter to the list of parameters to be passed to the underlying mechanism implementation. This method is provided in order to allow for future extensions.- Parameters:
name- The name of the additional authentication parameter.value- The value of the additional authentication parameter.- Returns:
- This bind request.
- Throws:
UnsupportedOperationException- If this bind request does not permit additional authentication parameters to be added.NullPointerException- Ifnameorvaluewasnull.
-
addControl
Description copied from interface:RequestAdds the provided control to this request.- Specified by:
addControlin interfaceBindRequest- Specified by:
addControlin interfaceRequest- Specified by:
addControlin interfaceSASLBindRequest- Parameters:
control- The control to be added to this request.- Returns:
- This request.
-
addQOP
Adds the provided quality of protection (QOP) values to the ordered list of QOP values that the client is willing to accept. The order of the list specifies the preference order, high to low. Authentication will fail if no QOP values are recognized or accepted by the server.By default the client will accept
AUTH.- Parameters:
qopValues- The quality of protection values that the client is willing to accept.- Returns:
- This bind request.
- Throws:
UnsupportedOperationException- If this bind request does not permit QOP values to be added.NullPointerException- IfqopValueswasnull.- See Also:
-
createBindClient
Description copied from interface:BindRequestCreates a new bind client which can be used to perform the authentication process. This method is called by protocol implementations and is not intended for use by applications.- Specified by:
createBindClientin interfaceBindRequest- Specified by:
createBindClientin interfaceSASLBindRequest- Parameters:
serverName- The non-null fully-qualified host name of the server to authenticate to.- Returns:
- The new bind client.
- Throws:
LdapException- If an error occurred while creating the bind client context.
-
getAdditionalAuthParams
Returns a map containing the provided additional authentication parameters to be passed to the underlying mechanism implementation. This method is provided in order to allow for future extensions.- Returns:
- A map containing the provided additional authentication parameters to be passed to the underlying mechanism implementation.
-
getAuthenticationID
Returns the authentication ID of the user, which should be the user's Kerberos principal. The authentication ID usually has the form "dn:" immediately followed by the distinguished name of the user, or "u:" followed by a user ID string, but other forms are permitted.NOTE: this will not be used if a
Subjectis specified.- Returns:
- The authentication ID of the user.
-
getAuthenticationType
byte getAuthenticationType()Returns the authentication mechanism identifier for this SASL bind request as defined by the LDAP protocol, which is always0xA3.- Specified by:
getAuthenticationTypein interfaceBindRequest- Specified by:
getAuthenticationTypein interfaceSASLBindRequest- Returns:
- The authentication mechanism identifier.
-
getAuthorizationID
Returns the optional authorization ID of the user which represents an alternate authorization identity which should be used for subsequent operations performed on the connection. The authorization ID usually has the form "dn:" immediately followed by the distinguished name of the user, or "u:" followed by a user ID string, but other forms are permitted.- Returns:
- The authorization ID of the user, which may be
null.
-
getControl
<C extends Control> C getControl(ControlDecoder<C> decoder, DecodeOptions options) throws DecodeException Description copied from interface:RequestDecodes and returns the first control in this request having an OID corresponding to the provided control decoder.- Specified by:
getControlin interfaceBindRequest- Specified by:
getControlin interfaceRequest- Specified by:
getControlin interfaceSASLBindRequest- Type Parameters:
C- The type of control to be decoded and returned.- Parameters:
decoder- The control decoder.options- The set of decode options which should be used when decoding the control.- Returns:
- The decoded control, or
nullif the control is not included with this request. - Throws:
DecodeException- If the control could not be decoded because it was malformed in some way (e.g. the control value was missing, or its content could not be decoded).
-
getControls
Description copied from interface:RequestReturns aListcontaining the controls included with this request. The returnedListmay be modified if permitted by this request.- Specified by:
getControlsin interfaceBindRequest- Specified by:
getControlsin interfaceRequest- Specified by:
getControlsin interfaceSASLBindRequest- Returns:
- A
Listcontaining the controls.
-
getKDCAddress
Returns the optional address of the Kerberos KDC (Key Distribution Center).NOTE: this will not be used if a
Subjectis specified.- Returns:
- The address of the Kerberos KDC (Key Distribution Center), which
may be
null.
-
getMaxReceiveBufferSize
int getMaxReceiveBufferSize()Returns the maximum size of the receive buffer in bytes. The actual maximum number of bytes will be the minimum of this number and the peer's maximum send buffer size. The default size is 65536.- Returns:
- The maximum size of the receive buffer in bytes.
-
getMaxSendBufferSize
int getMaxSendBufferSize()Returns the maximum size of the send buffer in bytes. The actual maximum number of bytes will be the minimum of this number and the peer's maximum receive buffer size. The default size is 65536.- Returns:
- The maximum size of the send buffer in bytes.
-
getName
Returns the name of the Directory object that the client wishes to bind as, which is always the empty string for SASL authentication.- Specified by:
getNamein interfaceBindRequest- Specified by:
getNamein interfaceSASLBindRequest- Returns:
- The name of the Directory object that the client wishes to bind as.
-
getPassword
byte[] getPassword()Returns the password of the user that the client wishes to bind as.Unless otherwise indicated, implementations will store a reference to the returned password byte array, allowing applications to overwrite the password after it has been used.
NOTE: this will not be used if a
Subjectis specified.- Returns:
- The password of the user that the client wishes to bind as.
-
getQOPs
Returns the ordered list of quality of protection (QOP) values that the client is willing to accept. The order of the list specifies the preference order, high to low. Authentication will fail if no QOP values are recognized or accepted by the server.By default the client will accept
AUTH.- Returns:
- The list of quality of protection values that the client is willing to accept. The returned list may be empty indicating that the default QOP will be accepted.
-
getRealm
Returns the optional realm containing the user's account.NOTE: this will not be used if a
Subjectis specified.- Returns:
- The name of the realm containing the user's account, which may be
null.
-
getSASLMechanism
Description copied from interface:SASLBindRequestReturns the SASL mechanism for this SASL bind request.- Specified by:
getSASLMechanismin interfaceSASLBindRequest- Returns:
- The SASL mechanism for this bind request.
-
getSubject
Returns the Kerberos subject of the user to be authenticated.NOTE: if a
Subjectis specified then the authentication ID, KDC address, password, and realm, will be ignored.- Returns:
- The Kerberos subject of the user to be authenticated.
-
isServerAuth
boolean isServerAuth()Returnstrueif the server must authenticate to the client. The default isfalse.- Returns:
trueif the server must authenticate to the client.
-
setAuthenticationID
Sets the authentication ID of the user, which should be the user's Kerberos principal. The authentication ID usually has the form "dn:" immediately followed by the distinguished name of the user, or "u:" followed by a user ID string, but other forms are permitted.NOTE: this will not be used if a
Subjectis specified.- Parameters:
authenticationID- The authentication ID of the user.- Returns:
- This bind request.
- Throws:
org.forgerock.i18n.LocalizedIllegalArgumentException- IfauthenticationIDwas non-empty and did not contain a valid authorization ID type.NullPointerException- IfauthenticationIDwasnull.
-
setAuthorizationID
Sets the optional authorization ID of the user which represents an alternate authorization identity which should be used for subsequent operations performed on the connection. The authorization ID usually has the form "dn:" immediately followed by the distinguished name of the user, or "u:" followed by a user ID string, but other forms are permitted.- Parameters:
authorizationID- The authorization ID of the user, which may benull.- Returns:
- This bind request.
- Throws:
org.forgerock.i18n.LocalizedIllegalArgumentException- IfauthorizationIDwas non-empty and did not contain a valid authorization ID type.
-
setKDCAddress
Sets the optional address of the Kerberos KDC (Key Distribution Center).NOTE: this will not be used if a
Subjectis specified.- Parameters:
address- The address of the Kerberos KDC (Key Distribution Center), which may benull.- Returns:
- This bind request.
- Throws:
UnsupportedOperationException- If this bind request does not permit the KDC address to be set.NullPointerException- Ifaddresswasnull.
-
setMaxReceiveBufferSize
Sets the maximum size of the receive buffer in bytes. The actual maximum number of bytes will be the minimum of this number and the peer's maximum send buffer size. The default size is 65536.- Parameters:
size- The maximum size of the receive buffer in bytes.- Returns:
- This bind request.
- Throws:
UnsupportedOperationException- If this bind request does not permit the buffer size to be set.
-
setMaxSendBufferSize
Sets the maximum size of the send buffer in bytes. The actual maximum number of bytes will be the minimum of this number and the peer's maximum receive buffer size. The default size is 65536.- Parameters:
size- The maximum size of the send buffer in bytes.- Returns:
- This bind request.
- Throws:
UnsupportedOperationException- If this bind request does not permit the buffer size to be set.
-
setPassword
Sets the password of the user that the client wishes to bind as.Unless otherwise indicated, implementations will store a reference to the provided password byte array, allowing applications to overwrite the password after it has been used.
NOTE: this will not be used if a
Subjectis specified.- Parameters:
password- The password of the user that the client wishes to bind as, which may be empty.- Returns:
- This bind request.
- Throws:
UnsupportedOperationException- If this bind request does not permit the password to be set.NullPointerException- Ifpasswordwasnull.
-
setPassword
Sets the password of the user that the client wishes to bind as. The password will be converted to a UTF-8 octet string.NOTE: this will not be used if a
Subjectis specified.- Parameters:
password- The password of the user that the client wishes to bind as.- Returns:
- This bind request.
- Throws:
UnsupportedOperationException- If this bind request does not permit the password to be set.NullPointerException- Ifpasswordwasnull.
-
setRealm
Sets the optional realm containing the user's account.NOTE: this will not be used if a
Subjectis specified.- Parameters:
realm- The name of the realm containing the user's account, which may benull.- Returns:
- This bind request.
- Throws:
UnsupportedOperationException- If this bind request does not permit the realm to be set.NullPointerException- Ifrealmwasnull.
-
setServerAuth
Specifies whether the server must authenticate to the client. The default isfalse.- Parameters:
serverAuth-trueif the server must authenticate to the client orfalseotherwise.- Returns:
- This bind request.
- Throws:
UnsupportedOperationException- If this bind request does not permit server auth to be set.
-
setSubject
Sets the Kerberos subject of the user to be authenticated.NOTE: if a
Subjectis specified then the authentication ID, KDC address, password, and realm, will be ignored.- Parameters:
subject- The Kerberos subject of the user to be authenticated.- Returns:
- This bind request.
- Throws:
UnsupportedOperationException- If this bind request does not permit the Kerberos subject to be set.NullPointerException- Ifsubjectwasnull.
-