public abstract class AbstractSaslCallbackHandler extends Object implements CallbackHandler
CallbackHandler
s. Implementations of SASL mechanisms
selectively override the methods relevant to their mechanism.CallbackHandler
Modifier and Type | Field and Description |
---|---|
protected CoreSession |
adminSession
The admin core session
|
protected org.apache.directory.api.ldap.model.message.BindRequest |
bindRequest
The associated BindRequest
|
protected DirectoryService |
directoryService
A reference on the DirectoryService instance
|
protected LdapSession |
ldapSession
The reference on the user ldap session
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractSaslCallbackHandler(DirectoryService directoryService,
org.apache.directory.api.ldap.model.message.BindRequest bindRequest)
Creates a new instance of AbstractSaslCallbackHandler.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
authorize(AuthorizeCallback callback)
Final check to authorize user.
|
protected LdapContext |
getContext(org.apache.mina.core.session.IoSession session,
org.apache.directory.api.ldap.model.message.BindRequest bindRequest,
Hashtable<String,Object> env)
Convenience method for acquiring an
LdapContext for the client to use for the
duration of a session. |
protected Hashtable<String,Object> |
getEnvironment(org.apache.mina.core.session.IoSession session)
Convenience method for getting an environment suitable for acquiring
an
LdapContext for the client. |
protected String |
getRealm()
Implementors use this method to access the realm resulting from a callback.
|
protected String |
getUsername()
Implementors use this method to access the username resulting from a callback.
|
void |
handle(Callback[] callbacks)
SaslServer will use this method to call various callbacks, depending on the SASL
mechanism in use for a session.
|
protected abstract org.apache.directory.api.ldap.model.entry.Attribute |
lookupPassword(String username,
String realm)
Implementors set the password based on a lookup, using the username and
realm as keys.
|
protected LdapSession ldapSession
protected CoreSession adminSession
protected final DirectoryService directoryService
protected final org.apache.directory.api.ldap.model.message.BindRequest bindRequest
protected AbstractSaslCallbackHandler(DirectoryService directoryService, org.apache.directory.api.ldap.model.message.BindRequest bindRequest)
directoryService
- The DirectoryService instancebindRequest
- The Bind requestprotected String getUsername()
NameCallback
is not used by GSSAPI.protected String getRealm()
RealmCallback
is not used by GSSAPI nor by CRAM-MD5.protected abstract org.apache.directory.api.ldap.model.entry.Attribute lookupPassword(String username, String realm)
username
- The username.realm
- The realm.protected abstract void authorize(AuthorizeCallback callback) throws Exception
true
if authentication was successful.callback
- An AuthorizeCallback
.Exception
- If the authorization failedpublic void handle(Callback[] callbacks)
handle
in interface CallbackHandler
callbacks
- An array of one or more callbacks.protected LdapContext getContext(org.apache.mina.core.session.IoSession session, org.apache.directory.api.ldap.model.message.BindRequest bindRequest, Hashtable<String,Object> env)
LdapContext
for the client to use for the
duration of a session.session
- The current session.bindRequest
- The current BindRequest.env
- An environment to be used to acquire an LdapContext
.LdapContext
for the client.protected Hashtable<String,Object> getEnvironment(org.apache.mina.core.session.IoSession session)
LdapContext
for the client.session
- The current session.LdapContext
for the client.Copyright © 2003–2023 The Apache Software Foundation. All rights reserved.