Class AuthenticationProviderSasl

java.lang.Object
org.apache.pulsar.broker.authentication.AuthenticationProviderSasl
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.pulsar.broker.authentication.AuthenticationProvider

public class AuthenticationProviderSasl extends Object implements org.apache.pulsar.broker.authentication.AuthenticationProvider
Authentication Provider for SASL (Simple Authentication and Security Layer). Note: This provider does not override the default implementation for AuthenticationProvider.authenticate(AuthenticationDataSource). As the Javadoc for the interface's method indicates, this method should only be implemented when using single stage authentication. In the case of this provider, the authentication is multi-stage.
  • Constructor Details

    • AuthenticationProviderSasl

      public AuthenticationProviderSasl()
  • Method Details

    • initialize

      public void initialize(ServiceConfiguration config) throws IOException
      Specified by:
      initialize in interface org.apache.pulsar.broker.authentication.AuthenticationProvider
      Throws:
      IOException
    • getAuthMethodName

      public String getAuthMethodName()
      Specified by:
      getAuthMethodName in interface org.apache.pulsar.broker.authentication.AuthenticationProvider
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • newAuthState

      public org.apache.pulsar.broker.authentication.AuthenticationState newAuthState(org.apache.pulsar.common.api.AuthData authData, SocketAddress remoteAddress, SSLSession sslSession) throws AuthenticationException
      Specified by:
      newAuthState in interface org.apache.pulsar.broker.authentication.AuthenticationProvider
      Throws:
      AuthenticationException
    • authRoleFromHttpRequest

      public String authRoleFromHttpRequest(javax.servlet.http.HttpServletRequest httpRequest) throws AuthenticationException
      Returns null if authentication has not completed. Return auth role if authentication has completed, and httpRequest's role token contains the authRole
      Throws:
      AuthenticationException
    • authenticateHttpRequest

      public boolean authenticateHttpRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
      Passed in request, set response, according to request. and return whether we should do following chain.doFilter or not.
      Specified by:
      authenticateHttpRequest in interface org.apache.pulsar.broker.authentication.AuthenticationProvider
      Throws:
      Exception