|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.server.ldap.handlers.bind.AbstractSaslCallbackHandler
public abstract class AbstractSaslCallbackHandler
Base class for all SASL CallbackHandler
s. Implementations of SASL mechanisms
selectively override the methods relevant to their mechanism.
CallbackHandler
Field Summary | |
---|---|
protected CoreSession |
adminSession
The admin core session |
protected org.apache.directory.shared.ldap.message.internal.InternalBindRequest |
bindRequest
The associated BindRequest |
protected DirectoryService |
directoryService
A reference on the DirectoryService instance |
protected LdapSession |
ldapSession
The reference on the user ldap session |
Constructor Summary | |
---|---|
protected |
AbstractSaslCallbackHandler(DirectoryService directoryService,
org.apache.directory.shared.ldap.message.internal.InternalBindRequest bindRequest)
Creates a new instance of AbstractSaslCallbackHandler. |
Method Summary | |
---|---|
protected abstract void |
authorize(javax.security.sasl.AuthorizeCallback callback)
Final check to authorize user. |
protected javax.naming.ldap.LdapContext |
getContext(org.apache.mina.core.session.IoSession session,
org.apache.directory.shared.ldap.message.internal.InternalBindRequest bindRequest,
java.util.Hashtable<java.lang.String,java.lang.Object> env)
Convenience method for acquiring an LdapContext for the client to use for the
duration of a session. |
protected java.util.Hashtable<java.lang.String,java.lang.Object> |
getEnvironment(org.apache.mina.core.session.IoSession session)
Convenience method for getting an environment suitable for acquiring an LdapContext for the client. |
protected java.lang.String |
getRealm()
Implementors use this method to access the realm resulting from a callback. |
protected java.lang.String |
getUsername()
Implementors use this method to access the username resulting from a callback. |
void |
handle(javax.security.auth.callback.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.shared.ldap.entry.EntryAttribute |
lookupPassword(java.lang.String username,
java.lang.String realm)
Implementors set the password based on a lookup, using the username and realm as keys. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected LdapSession ldapSession
protected CoreSession adminSession
protected final DirectoryService directoryService
protected final org.apache.directory.shared.ldap.message.internal.InternalBindRequest bindRequest
Constructor Detail |
---|
protected AbstractSaslCallbackHandler(DirectoryService directoryService, org.apache.directory.shared.ldap.message.internal.InternalBindRequest bindRequest)
directoryService
- Method Detail |
---|
protected java.lang.String getUsername()
NameCallback
is not used by GSSAPI.
protected java.lang.String getRealm()
RealmCallback
is not used by GSSAPI nor by CRAM-MD5.
protected abstract org.apache.directory.shared.ldap.entry.EntryAttribute lookupPassword(java.lang.String username, java.lang.String realm)
username
- The username.realm
- The realm.
protected abstract void authorize(javax.security.sasl.AuthorizeCallback callback) throws java.lang.Exception
true
if authentication was successful.
callback
- An AuthorizeCallback
.
java.lang.Exception
public void handle(javax.security.auth.callback.Callback[] callbacks)
handle
in interface javax.security.auth.callback.CallbackHandler
callbacks
- An array of one or more callbacks.protected javax.naming.ldap.LdapContext getContext(org.apache.mina.core.session.IoSession session, org.apache.directory.shared.ldap.message.internal.InternalBindRequest bindRequest, java.util.Hashtable<java.lang.String,java.lang.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 java.util.Hashtable<java.lang.String,java.lang.Object> getEnvironment(org.apache.mina.core.session.IoSession session)
LdapContext
for the client.
session
- The current session.
LdapContext
for the client.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |