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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanauthenticateHttpRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Passed in request, set response, according to request.authRoleFromHttpRequest(javax.servlet.http.HttpServletRequest httpRequest) Returns null if authentication has not completed.voidclose()voidinitialize(ServiceConfiguration config) org.apache.pulsar.broker.authentication.AuthenticationStatenewAuthState(org.apache.pulsar.common.api.AuthData authData, SocketAddress remoteAddress, SSLSession sslSession) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.broker.authentication.AuthenticationProvider
authenticate, authenticateAsync, authenticateHttpRequestAsync, incrementFailureMetric, newHttpAuthState
-
Constructor Details
-
AuthenticationProviderSasl
public AuthenticationProviderSasl()
-
-
Method Details
-
initialize
- Specified by:
initializein interfaceorg.apache.pulsar.broker.authentication.AuthenticationProvider- Throws:
IOException
-
getAuthMethodName
- Specified by:
getAuthMethodNamein interfaceorg.apache.pulsar.broker.authentication.AuthenticationProvider
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- 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:
newAuthStatein interfaceorg.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:
authenticateHttpRequestin interfaceorg.apache.pulsar.broker.authentication.AuthenticationProvider- Throws:
Exception
-