Class AuthenticationProviderToken
- java.lang.Object
-
- org.apache.pulsar.broker.authentication.AuthenticationProviderToken
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,AuthenticationProvider
public class AuthenticationProviderToken extends java.lang.Object implements AuthenticationProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAuthenticationProviderToken.HttpServletRequestWrapper
-
Constructor Summary
Constructors Constructor Description AuthenticationProviderToken()
-
Method Summary
All Methods Static 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.voidclose()java.lang.StringgetAuthMethodName()static java.lang.StringgetToken(AuthenticationDataSource authData)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.static voidresetMetrics()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pulsar.broker.authentication.AuthenticationProvider
authenticateHttpRequest
-
-
-
-
Method Detail
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
resetMetrics
public static void resetMetrics()
-
initialize
public void initialize(ServiceConfiguration config) throws java.io.IOException, java.lang.IllegalArgumentException
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 failsjava.lang.IllegalArgumentException
-
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
-
getToken
public static java.lang.String getToken(AuthenticationDataSource authData) throws javax.naming.AuthenticationException
- Throws:
javax.naming.AuthenticationException
-
-