Interface AuthenticationProvider
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Implementing Classes:
AuthenticationProviderBasic,AuthenticationProviderList,AuthenticationProviderTls,AuthenticationProviderToken
public interface AuthenticationProvider extends java.io.CloseableProvider of authentication mechanism.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.Stringauthenticate(AuthenticationDataSource authData)Validate the authentication for the given credentials with the specified authentication data.default booleanauthenticateHttpRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Set response, according to passed in request.java.lang.StringgetAuthMethodName()voidinitialize(ServiceConfiguration config)Perform initialization for the authentication provider.default 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.
-
-
-
Method Detail
-
initialize
void initialize(ServiceConfiguration config) throws java.io.IOException
Perform initialization for the authentication provider.- Parameters:
config- broker config object- Throws:
java.io.IOException- if the initialization fails
-
getAuthMethodName
java.lang.String getAuthMethodName()
- Returns:
- the authentication method name supported by this provider
-
authenticate
default java.lang.String authenticate(AuthenticationDataSource authData) throws javax.naming.AuthenticationException
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.- 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
default AuthenticationState newAuthState(org.apache.pulsar.common.api.AuthData authData, java.net.SocketAddress remoteAddress, javax.net.ssl.SSLSession sslSession) throws javax.naming.AuthenticationException
Create an authentication data State use passed in AuthenticationDataSource.- Throws:
javax.naming.AuthenticationException
-
authenticateHttpRequest
default boolean authenticateHttpRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.ExceptionSet response, according to passed in request. and return whether we should do following chain.doFilter or not.- Throws:
java.lang.Exception
-
-