Interface AuthenticationProvider

    • Method Detail

      • initialize

        void initialize​(ServiceConfiguration config)
                 throws java.io.IOException
        Perform initialization for the authentication provider.
        Parameters:
        config - broker config object
        Throws:
        java.io.IOException - if the initialization fails
      • getAuthMethodName

        java.lang.String getAuthMethodName()
        Returns:
        the authentication method name supported by this provider
      • authenticate

        default java.lang.String authenticate​(AuthenticationDataSource authData)
                                       throws javax.naming.AuthenticationException
        Validate the authentication for the given credentials with the specified authentication data. This method is useful in one stage authn, if you're not doing one stage or if you're providing your own state implementation for one stage authn, it should throw an exception.
        Parameters:
        authData - provider specific authentication data
        Returns:
        the "role" string for the authenticated connection, if the authentication was successful
        Throws:
        javax.naming.AuthenticationException - if the credentials are not valid
      • newAuthState

        default AuthenticationState newAuthState​(org.apache.pulsar.common.api.AuthData authData,
                                                 java.net.SocketAddress remoteAddress,
                                                 javax.net.ssl.SSLSession sslSession)
                                          throws javax.naming.AuthenticationException
        Create an authentication data State use passed in AuthenticationDataSource.
        Throws:
        javax.naming.AuthenticationException
      • authenticateHttpRequest

        default boolean authenticateHttpRequest​(javax.servlet.http.HttpServletRequest request,
                                                javax.servlet.http.HttpServletResponse response)
                                         throws java.lang.Exception
        Set response, according to passed in request. and return whether we should do following chain.doFilter or not.
        Throws:
        java.lang.Exception