public interface AuthenticationState
| Modifier and Type | Method and Description |
|---|---|
org.apache.pulsar.common.api.AuthData |
authenticate(org.apache.pulsar.common.api.AuthData authData)
Deprecated.
use and implement
authenticateAsync(AuthData) instead. |
default CompletableFuture<org.apache.pulsar.common.api.AuthData> |
authenticateAsync(org.apache.pulsar.common.api.AuthData authData)
Challenge passed in auth data.
|
AuthenticationDataSource |
getAuthDataSource()
Return AuthenticationDataSource.
|
String |
getAuthRole()
After the authentication between client and broker completed,
get authentication role represent for the client.
|
default long |
getStateId()
Get AuthenticationState ID
|
boolean |
isComplete()
Deprecated.
this method's logic is captured by the result of
authenticateAsync(AuthData). When the result is a CompletableFuture with a
null result, authentication is complete. When the result is a CompletableFuture with a nonnull result,
authentication is incomplete and requires an auth challenge. |
default boolean |
isExpired()
If the authentication state is expired, it will force the connection to be re-authenticated.
|
default org.apache.pulsar.common.api.AuthData |
refreshAuthentication()
If the authentication state supports refreshing and the credentials are expired,
the auth provider will call this method to initiate the refresh process.
|
String getAuthRole() throws AuthenticationException
AuthenticationException@Deprecated org.apache.pulsar.common.api.AuthData authenticate(org.apache.pulsar.common.api.AuthData authData) throws AuthenticationException
authenticateAsync(AuthData) instead.AuthenticationExceptiondefault CompletableFuture<org.apache.pulsar.common.api.AuthData> authenticateAsync(org.apache.pulsar.common.api.AuthData authData)
Note: the implementation of authenticate(AuthData) converted a null result into a
zero length byte array when isComplete() returned false after authentication. In
order to simplify this interface, the determination of whether to send a challenge back to the client is only
based on the result of this method. In order to maintain backwards compatibility, the default implementation of
this method calls isComplete() and returns a result compliant with the new
paradigm.
AuthenticationDataSource getAuthDataSource()
@Deprecated boolean isComplete()
authenticateAsync(AuthData). When the result is a CompletableFuture with a
null result, authentication is complete. When the result is a CompletableFuture with a nonnull result,
authentication is incomplete and requires an auth challenge.default long getStateId()
default boolean isExpired()
default org.apache.pulsar.common.api.AuthData refreshAuthentication()
throws AuthenticationException
The auth state here will return the broker side data that will be used to send a challenge to the client.
AuthData for the broker challenge to clientAuthenticationExceptionCopyright © 2017–2021 Apache Software Foundation. All rights reserved.