Class AuthenticationProviderList

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, AuthenticationProvider

    public class AuthenticationProviderList
    extends java.lang.Object
    implements AuthenticationProvider
    An authentication provider wraps a list of auth providers.
    • Constructor Detail

      • AuthenticationProviderList

        public AuthenticationProviderList​(java.util.List<AuthenticationProvider> providers)
    • Method Detail

      • initialize

        public void initialize​(ServiceConfiguration config)
                        throws java.io.IOException
        Description copied from interface: AuthenticationProvider
        Perform initialization for the authentication provider.
        Specified by:
        initialize in interface AuthenticationProvider
        Parameters:
        config - broker config object
        Throws:
        java.io.IOException - if the initialization fails
      • getAuthMethodName

        public java.lang.String getAuthMethodName()
        Specified by:
        getAuthMethodName in interface AuthenticationProvider
        Returns:
        the authentication method name supported by this provider
      • authenticate

        public java.lang.String authenticate​(AuthenticationDataSource authData)
                                      throws javax.naming.AuthenticationException
        Description copied from interface: AuthenticationProvider
        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.
        Specified by:
        authenticate in interface AuthenticationProvider
        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

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

        public boolean authenticateHttpRequest​(javax.servlet.http.HttpServletRequest request,
                                               javax.servlet.http.HttpServletResponse response)
                                        throws java.lang.Exception
        Description copied from interface: AuthenticationProvider
        Set response, according to passed in request. and return whether we should do following chain.doFilter or not.
        Specified by:
        authenticateHttpRequest in interface AuthenticationProvider
        Throws:
        java.lang.Exception
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException