public interface AuthenticationProvider extends Closeable
| Modifier and Type | Method and Description |
|---|---|
default String |
authenticate(AuthenticationDataSource authData)
Deprecated.
use and implement
authenticateAsync(AuthenticationDataSource) instead. |
default CompletableFuture<String> |
authenticateAsync(AuthenticationDataSource authData)
Validate the authentication for the given credentials with the specified authentication data.
|
default boolean |
authenticateHttpRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Deprecated.
use and implement
authenticateHttpRequestAsync(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) instead. |
default CompletableFuture<Boolean> |
authenticateHttpRequestAsync(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Validate the authentication for the given credentials with the specified authentication data.
|
String |
getAuthMethodName() |
void |
initialize(ServiceConfiguration config)
Perform initialization for the authentication provider.
|
default AuthenticationState |
newAuthState(org.apache.pulsar.common.api.AuthData authData,
SocketAddress remoteAddress,
SSLSession sslSession)
Create an authentication data State use passed in AuthenticationDataSource.
|
void initialize(ServiceConfiguration config) throws IOException
config - broker config objectIOException - if the initialization failsString getAuthMethodName()
default CompletableFuture<String> authenticateAsync(AuthenticationDataSource authData)
Warning: the calling thread is an IO thread. Any implementation that relies on blocking behavior must ensure that the execution is completed using a separate thread pool to ensure IO threads are never blocked.
authData - authentication data generated while initiating a connection. There are several types,
including, but not strictly limited to, AuthenticationDataHttp,
AuthenticationDataHttps, and AuthenticationDataCommand.@Deprecated default String authenticate(AuthenticationDataSource authData) throws AuthenticationException
authenticateAsync(AuthenticationDataSource) instead.authData - provider specific authentication dataAuthenticationException - if the credentials are not validdefault AuthenticationState newAuthState(org.apache.pulsar.common.api.AuthData authData, SocketAddress remoteAddress, SSLSession sslSession) throws AuthenticationException
AuthenticationException@InterfaceStability.Unstable default CompletableFuture<Boolean> authenticateHttpRequestAsync(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Warning: the calling thread is an IO thread. Any implementations that rely on blocking behavior must ensure that the execution is completed on using a separate thread pool to ensure IO threads are never blocked.
Note: this method is marked as unstable because the Pulsar code base only calls it for the
Pulsar Broker Auth SASL plugin. All non SASL HTTP requests are authenticated using the
authenticateAsync(AuthenticationDataSource) method. As such,
this method might be removed in favor of the SASL provider implementing the
authenticateAsync(AuthenticationDataSource) method.
@Deprecated default boolean authenticateHttpRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
authenticateHttpRequestAsync(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) instead.ExceptionCopyright © 2017–2022 Apache Software Foundation. All rights reserved.