Interface AuthenticationState

  • All Known Implementing Classes:
    OneStageAuthenticationState

    public interface AuthenticationState
    Interface 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.AuthData authenticate​(org.apache.pulsar.common.api.AuthData authData)
      Challenge passed in auth data and get response data.
      AuthenticationDataSource getAuthDataSource()
      Return AuthenticationDataSource.
      java.lang.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()
      Whether the authentication is completed or not.
      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.
    • Method Detail

      • getAuthRole

        java.lang.String getAuthRole()
                              throws javax.naming.AuthenticationException
        After 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.AuthenticationException
        Challenge passed in auth data and get response data.
        Throws:
        javax.naming.AuthenticationException
      • 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.AuthenticationException
        If 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 AuthData for the broker challenge to client
        Throws:
        javax.naming.AuthenticationException