Class ClientAuthBlock


  • public final class ClientAuthBlock
    extends java.lang.Object
    Manages client authentication with multiple pluginProviders.

    This is similar to the ClntAuthBlock in Firebird. For ease of understanding, and correlating with the Firebird implementation, this uses the same (or very similar) terms and structure (if it makes sense).

    Since:
    3.0
    Author:
    Mark Rotteveel
    • Constructor Detail

      • ClientAuthBlock

        public ClientAuthBlock​(IAttachProperties<?> attachProperties)
                        throws java.sql.SQLException
        Throws:
        java.sql.SQLException
    • Method Detail

      • getLogin

        public java.lang.String getLogin()
      • getNormalizedLogin

        public java.lang.String getNormalizedLogin()
      • getPassword

        public java.lang.String getPassword()
      • isAuthComplete

        public boolean isAuthComplete()
      • setAuthComplete

        public void setAuthComplete​(boolean authComplete)
      • getCurrentPluginName

        public java.lang.String getCurrentPluginName()
      • getPluginNames

        public java.lang.String getPluginNames()
        Returns:
        Comma separated list of available plugins.
      • getClientData

        public byte[] getClientData()
      • setFirstTime

        public void setFirstTime​(boolean firstTime)
      • isFirstTime

        public boolean isFirstTime()
      • authenticateStep0

        public void authenticateStep0()
                               throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • resetClient

        public void resetClient​(byte[] serverInfo)
                         throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • setServerData

        public void setServerData​(byte[] serverData)
      • writePluginDataTo

        public void writePluginDataTo​(java.io.OutputStream userId)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • switchPlugin

        public boolean switchPlugin​(java.lang.String pluginName)
      • hasPlugin

        public boolean hasPlugin()
      • authFillParametersBlock

        public void authFillParametersBlock​(ConnectionParameterBuffer pb)
                                     throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • supportsEncryption

        public boolean supportsEncryption()
                                   throws java.sql.SQLException
        TODO Need to handle this differently
        Returns:
        true if the encryption is supported
        Throws:
        java.sql.SQLException - If it is impossible to determine if encryption is supported (e.g. there is no current auth plugin)
      • getSessionKey

        public byte[] getSessionKey()
                             throws java.sql.SQLException
        Returns:
        Session key
        Throws:
        java.sql.SQLException - If a session key cannot be provided