public class AuthDescriptor extends Object
Constructor and Description |
---|
AuthDescriptor(String[] m,
CallbackHandler h)
Request authentication using the given list of mechanisms and callback
handler.
|
Modifier and Type | Method and Description |
---|---|
boolean |
authThresholdReached() |
CallbackHandler |
getCallback() |
String[] |
getMechs() |
static AuthDescriptor |
typical(String u,
String p)
Get a typical auth descriptor for CRAM-MD5 or PLAIN auth with the given
username and password.
|
public AuthDescriptor(String[] m, CallbackHandler h)
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.
m
- list of mechanismsh
- the callback handler for grabbing credentials and stuffpublic static AuthDescriptor typical(String u, String p)
u
- the usernamep
- the passwordpublic boolean authThresholdReached()
public String[] getMechs()
public CallbackHandler getCallback()
Copyright © 2022. All rights reserved.