@InterfaceAudience.LimitedPrivate @InterfaceStability.Stable public final class AuthenticationFactory extends Object
Authentication instances
for all the supported authentication methods.| Constructor and Description |
|---|
AuthenticationFactory() |
| Modifier and Type | Method and Description |
|---|---|
static Authentication |
create(String authPluginClassName,
Map<String,String> authParams)
Create an instance of the Authentication-Plugin.
|
static Authentication |
create(String authPluginClassName,
String authParamsString)
Create an instance of the
Authentication object by using
the plugin class name. |
static Authentication |
TLS(String certFilePath,
String keyFilePath)
Create an authentication provider for TLS based authentication.
|
static Authentication |
token(String token)
Create an authentication provider for token based authentication.
|
static Authentication |
token(Supplier<String> tokenSupplier)
Create an authentication provider for token based authentication.
|
public static Authentication token(String token)
token - the client auth tokenpublic static Authentication token(Supplier<String> tokenSupplier)
tokenSupplier - a supplier of the client auth tokenpublic static Authentication TLS(String certFilePath, String keyFilePath)
certFilePath - the path to the TLS client public keykeyFilePath - the path to the TLS client private keypublic static Authentication create(String authPluginClassName, String authParamsString) throws PulsarClientException.UnsupportedAuthenticationException
Authentication object by using
the plugin class name.authPluginClassName - name of the Authentication-Plugin you want to useauthParamsString - string which represents parameters for the Authentication-Plugin, e.g., "key1:val1,key2:val2"PulsarClientException.UnsupportedAuthenticationExceptionpublic static Authentication create(String authPluginClassName, Map<String,String> authParams) throws PulsarClientException.UnsupportedAuthenticationException
authPluginClassName - name of the Authentication-Plugin you want to useauthParams - map which represents parameters for the Authentication-PluginPulsarClientException.UnsupportedAuthenticationExceptionCopyright © 2017–2021 Apache Software Foundation. All rights reserved.