Package net.spy.memcached.auth
Class AuthDescriptor
java.lang.Object
net.spy.memcached.auth.AuthDescriptor
Information required to specify authentication mechanisms and callbacks.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private int
private final CallbackHandler
private final String[]
-
Constructor Summary
ConstructorsConstructorDescriptionAuthDescriptor
(String[] m, CallbackHandler h) Request authentication using the given list of mechanisms and callback handler. -
Method Summary
Modifier and TypeMethodDescriptionboolean
String[]
getMechs()
static AuthDescriptor
Get a typical auth descriptor for CRAM-MD5 or PLAIN auth with the given username and password.
-
Field Details
-
mechs
-
cbh
-
authAttempts
private int authAttempts -
allowedAuthAttempts
private int allowedAuthAttempts
-
-
Constructor Details
-
AuthDescriptor
Request authentication using the given list of mechanisms and callback handler.If the list of mechanisms is empty, then the client will try to fetch a list of supported SASL mechanisms from the server. If this is not supported by the server or a specific method needs to be forced, passing a specific list of mechanisms in will work.
For example, if the server would support CRAM-MD5 and PLAIN, the most secure variant (CRAM-MD5) will be chosen by default. If PLAIN should be used instead, passing in new String[] {"PLAIN"} will force the client to use PLAIN.
- Parameters:
m
- list of mechanismsh
- the callback handler for grabbing credentials and stuff
-
-
Method Details
-
typical
Get a typical auth descriptor for CRAM-MD5 or PLAIN auth with the given username and password.- Parameters:
u
- the usernamep
- the password- Returns:
- an AuthDescriptor
-
authThresholdReached
public boolean authThresholdReached() -
getMechs
-
getCallback
-