Class AuthenticationProviderToken

    • Constructor Detail

      • AuthenticationProviderToken

        public AuthenticationProviderToken()
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.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: AuthenticationProvider
        Perform initialization for the authentication provider.
        Specified by:
        initialize in interface AuthenticationProvider
        Parameters:
        config - broker config object
        Throws:
        java.io.IOException - if the initialization fails
        java.lang.IllegalArgumentException
      • getAuthMethodName

        public java.lang.String getAuthMethodName()
        Specified by:
        getAuthMethodName in interface AuthenticationProvider
        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: AuthenticationProvider
        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.
        Specified by:
        authenticate in interface AuthenticationProvider
        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: AuthenticationProvider
        Create an authentication data State use passed in AuthenticationDataSource.
        Specified by:
        newAuthState in interface AuthenticationProvider
        Throws:
        javax.naming.AuthenticationException
      • getToken

        public static java.lang.String getToken​(AuthenticationDataSource authData)
                                         throws javax.naming.AuthenticationException
        Throws:
        javax.naming.AuthenticationException