public abstract class PlainSaslAuthenticator extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
USER_RESOURCE_ID |
| Constructor and Description |
|---|
PlainSaslAuthenticator(AuthAttemptCache successfulAuthCache,
AuthAttemptCache failedAuthCache) |
| Modifier and Type | Method and Description |
|---|---|
io.confluent.kafka.multitenant.MultiTenantPrincipal |
authenticate(PlainSaslCredentials credentials)
Authenticate user by checking username, password, cluster id and network ID.
|
Optional<String> |
clusterId(String username)
return cluster Id for the given username/APIKey
|
static String |
configEntryOption(List<AppConfigurationEntry> configurationEntries,
String key,
String loginModuleName) |
void |
initialize(List<AppConfigurationEntry> jaasContextEntries) |
static io.confluent.kafka.multitenant.MultiTenantPrincipal |
multiTenantPrincipal(String username,
io.confluent.kafka.server.plugins.auth.MultiTenantSaslConfigEntry userInfo) |
public static final String USER_RESOURCE_ID
public PlainSaslAuthenticator(AuthAttemptCache successfulAuthCache, AuthAttemptCache failedAuthCache)
public static io.confluent.kafka.multitenant.MultiTenantPrincipal multiTenantPrincipal(String username, io.confluent.kafka.server.plugins.auth.MultiTenantSaslConfigEntry userInfo)
public io.confluent.kafka.multitenant.MultiTenantPrincipal authenticate(PlainSaslCredentials credentials) throws SaslException, org.apache.kafka.common.errors.SaslAuthenticationException
credentials - 'credentials' which includes username, password and information like sni hostname for authentication.MultiTenantPrincipal containing authorization id and tenantorg.apache.kafka.common.errors.SaslAuthenticationException - if authentication fails.
Note that the error string in the SaslAuthenticationException
is returned to the client so do not leak information in it.SaslException - if any unexpected errors are encounteredpublic static String configEntryOption(List<AppConfigurationEntry> configurationEntries, String key, String loginModuleName)
public Optional<String> clusterId(String username) throws SaslException
SaslExceptionpublic void initialize(List<AppConfigurationEntry> jaasContextEntries)