@InterfaceAudience.Private public class HBaseSaslRpcClient extends Object
org.apache.hadoop.security
Modifier and Type | Class and Description |
---|---|
(package private) static class |
HBaseSaslRpcClient.SaslClientCallbackHandler |
Modifier and Type | Field and Description |
---|---|
private boolean |
fallbackAllowed |
private static org.apache.commons.logging.Log |
LOG |
private SaslClient |
saslClient |
Constructor and Description |
---|
HBaseSaslRpcClient(AuthMethod method,
org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token,
String serverPrincipal,
boolean fallbackAllowed)
Create a HBaseSaslRpcClient for an authentication method
|
HBaseSaslRpcClient(AuthMethod method,
org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token,
String serverPrincipal,
boolean fallbackAllowed,
String rpcProtection)
Create a HBaseSaslRpcClient for an authentication method
|
Modifier and Type | Method and Description |
---|---|
protected SaslClient |
createDigestSaslClient(String[] mechanismNames,
String saslDefaultRealm,
CallbackHandler saslClientCallbackHandler) |
protected SaslClient |
createKerberosSaslClient(String[] mechanismNames,
String userFirstPart,
String userSecondPart) |
void |
dispose()
Release resources used by wrapped saslClient
|
InputStream |
getInputStream(InputStream in)
Get a SASL wrapped InputStream.
|
OutputStream |
getOutputStream(OutputStream out)
Get a SASL wrapped OutputStream.
|
private static void |
readStatus(DataInputStream inStream) |
boolean |
saslConnect(InputStream inS,
OutputStream outS)
Do client side SASL authentication with server via the given InputStream
and OutputStream
|
private static final org.apache.commons.logging.Log LOG
private final SaslClient saslClient
private final boolean fallbackAllowed
public HBaseSaslRpcClient(AuthMethod method, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token, String serverPrincipal, boolean fallbackAllowed) throws IOException
method
- the requested authentication methodtoken
- token to use if needed by the authentication methodserverPrincipal
- the server principal that we are trying to set the connection up tofallbackAllowed
- does the client allow fallback to simple authenticationIOException
public HBaseSaslRpcClient(AuthMethod method, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token, String serverPrincipal, boolean fallbackAllowed, String rpcProtection) throws IOException
method
- the requested authentication methodtoken
- token to use if needed by the authentication methodserverPrincipal
- the server principal that we are trying to set the connection up tofallbackAllowed
- does the client allow fallback to simple authenticationrpcProtection
- the protection level ("authentication", "integrity" or "privacy")IOException
protected SaslClient createDigestSaslClient(String[] mechanismNames, String saslDefaultRealm, CallbackHandler saslClientCallbackHandler) throws IOException
IOException
protected SaslClient createKerberosSaslClient(String[] mechanismNames, String userFirstPart, String userSecondPart) throws IOException
IOException
private static void readStatus(DataInputStream inStream) throws IOException
IOException
public boolean saslConnect(InputStream inS, OutputStream outS) throws IOException
inS
- InputStream to useoutS
- OutputStream to useIOException
public InputStream getInputStream(InputStream in) throws IOException
in
- the InputStream to wrapIOException
public OutputStream getOutputStream(OutputStream out) throws IOException
out
- the OutputStream to wrapIOException
public void dispose() throws SaslException
SaslException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.