Interface AuthenticationState
-
- All Known Implementing Classes:
OneStageAuthenticationState
public interface AuthenticationStateInterface for authentication state. It tell broker whether the authentication is completed or not, if completed, what is the AuthRole is.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description org.apache.pulsar.common.api.AuthDataauthenticate(org.apache.pulsar.common.api.AuthData authData)Challenge passed in auth data and get response data.AuthenticationDataSourcegetAuthDataSource()Return AuthenticationDataSource.java.lang.StringgetAuthRole()After the authentication between client and broker completed, get authentication role represent for the client.default longgetStateId()Get AuthenticationState ID.booleanisComplete()Whether the authentication is completed or not.default booleanisExpired()If the authentication state is expired, it will force the connection to be re-authenticated.default org.apache.pulsar.common.api.AuthDatarefreshAuthentication()If the authentication state supports refreshing and the credentials are expired, the auth provider will call this method to initiate the refresh process.
-
-
-
Method Detail
-
getAuthRole
java.lang.String getAuthRole() throws javax.naming.AuthenticationExceptionAfter the authentication between client and broker completed, get authentication role represent for the client. It should throw exception if auth not complete.- Throws:
javax.naming.AuthenticationException
-
authenticate
org.apache.pulsar.common.api.AuthData authenticate(org.apache.pulsar.common.api.AuthData authData) throws javax.naming.AuthenticationExceptionChallenge passed in auth data and get response data.- Throws:
javax.naming.AuthenticationException
-
getAuthDataSource
AuthenticationDataSource getAuthDataSource()
Return AuthenticationDataSource.
-
isComplete
boolean isComplete()
Whether the authentication is completed or not.
-
getStateId
default long getStateId()
Get AuthenticationState ID.
-
isExpired
default boolean isExpired()
If the authentication state is expired, it will force the connection to be re-authenticated.
-
refreshAuthentication
default org.apache.pulsar.common.api.AuthData refreshAuthentication() throws javax.naming.AuthenticationExceptionIf the authentication state supports refreshing and the credentials are expired, the auth provider will call this method to initiate the refresh process.The auth state here will return the broker side data that will be used to send a challenge to the client.
- Returns:
- the
AuthDatafor the broker challenge to client - Throws:
javax.naming.AuthenticationException
-
-