Class AuthenticationProviderList
- java.lang.Object
-
- org.apache.pulsar.broker.authentication.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 Summary
Constructors Constructor Description AuthenticationProviderList(java.util.List<AuthenticationProvider> providers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringauthenticate(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()java.lang.StringgetAuthMethodName()java.util.List<AuthenticationProvider>getProviders()voidinitialize(ServiceConfiguration config)Perform initialization for the authentication provider.AuthenticationStatenewAuthState(org.apache.pulsar.common.api.AuthData authData, java.net.SocketAddress remoteAddress, javax.net.ssl.SSLSession sslSession)Create an authentication data State use passed in AuthenticationDataSource.
-
-
-
Constructor Detail
-
AuthenticationProviderList
public AuthenticationProviderList(java.util.List<AuthenticationProvider> providers)
-
-
Method Detail
-
getProviders
public java.util.List<AuthenticationProvider> getProviders()
-
initialize
public void initialize(ServiceConfiguration config) throws java.io.IOException
Description copied from interface:AuthenticationProviderPerform initialization for the authentication provider.- Specified by:
initializein interfaceAuthenticationProvider- Parameters:
config- broker config object- Throws:
java.io.IOException- if the initialization fails
-
getAuthMethodName
public java.lang.String getAuthMethodName()
- Specified by:
getAuthMethodNamein interfaceAuthenticationProvider- 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: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:
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:AuthenticationProviderCreate an authentication data State use passed in AuthenticationDataSource.- Specified by:
newAuthStatein interfaceAuthenticationProvider- Throws:
javax.naming.AuthenticationException
-
authenticateHttpRequest
public boolean authenticateHttpRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.ExceptionDescription 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:
java.lang.Exception
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-