Class AuthenticationProviderList
java.lang.Object
org.apache.pulsar.broker.authentication.AuthenticationProviderList
- All Implemented Interfaces:
Closeable,AutoCloseable,AuthenticationProvider
An authentication provider wraps a list of auth providers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(AuthenticationDataSource authData) Validate the authentication for the given credentials with the specified authentication data.booleanauthenticateHttpRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Set response, according to passed in request.voidclose()voidinitialize(ServiceConfiguration config) Perform initialization for the authentication provider.newAuthState(org.apache.pulsar.common.api.AuthData authData, SocketAddress remoteAddress, SSLSession sslSession) Create an authentication data State use passed in AuthenticationDataSource.newHttpAuthState(javax.servlet.http.HttpServletRequest request) Create an http authentication data State use passed in AuthenticationDataSource.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
authenticateAsync, authenticateHttpRequestAsync, incrementFailureMetric
-
Constructor Details
-
AuthenticationProviderList
-
-
Method Details
-
getProviders
-
initialize
Description copied from interface:AuthenticationProviderPerform initialization for the authentication provider.- Specified by:
initializein interfaceAuthenticationProvider- Parameters:
config- broker config object- Throws:
IOException- if the initialization fails
-
getAuthMethodName
- Specified by:
getAuthMethodNamein interfaceAuthenticationProvider- Returns:
- the authentication method name supported by this provider
-
authenticate
Description copied from interface:AuthenticationProviderValidate 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:
authenticatein interfaceAuthenticationProvider- Parameters:
authData- provider specific authentication data- Returns:
- the "role" string for the authenticated connection, if the authentication was successful
- Throws:
AuthenticationException- if the credentials are not valid
-
newAuthState
public AuthenticationState newAuthState(org.apache.pulsar.common.api.AuthData authData, SocketAddress remoteAddress, SSLSession sslSession) throws AuthenticationException Description copied from interface:AuthenticationProviderCreate an authentication data State use passed in AuthenticationDataSource.- Specified by:
newAuthStatein interfaceAuthenticationProvider- Throws:
AuthenticationException
-
newHttpAuthState
public AuthenticationState newHttpAuthState(javax.servlet.http.HttpServletRequest request) throws AuthenticationException Description copied from interface:AuthenticationProviderCreate an http authentication data State use passed in AuthenticationDataSource.- Specified by:
newHttpAuthStatein interfaceAuthenticationProvider- Throws:
AuthenticationException
-
authenticateHttpRequest
public boolean authenticateHttpRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception Description copied from interface:AuthenticationProviderSet response, according to passed in request. and return whether we should do following chain.doFilter or not.- Specified by:
authenticateHttpRequestin interfaceAuthenticationProvider- Throws:
Exception
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-