Class KeyAuthenticationProvider

    • Constructor Detail

      • KeyAuthenticationProvider

        public KeyAuthenticationProvider()
    • Method Detail

      • getScheme

        public String getScheme()
        Description copied from interface: AuthenticationProvider
        The String used to represent this provider. This will correspond to the scheme field of an Id.
        Returns:
        the scheme of this provider.
      • handleAuthentication

        public KeeperException.Code handleAuthentication​(ServerAuthenticationProvider.ServerObjs serverObjs,
                                                         byte[] authData)
        Description copied from class: ServerAuthenticationProvider
        This method is called when a client passes authentication data for this scheme. The authData is directly from the authentication packet. The implementor may attach new ids to the authInfo field of cnxn or may use cnxn to send packets back to the client.
        Specified by:
        handleAuthentication in class ServerAuthenticationProvider
        Parameters:
        serverObjs - cnxn/server/etc that received the authentication information.
        authData - the authentication data received.
        Returns:
        indication of success or failure
      • isAuthenticated

        public boolean isAuthenticated()
        Description copied from interface: AuthenticationProvider
        This method is used to check if the authentication done by this provider should be used to identify the creator of a node. Some ids such as hosts and ip addresses are rather transient and in general don't really identify a client even though sometimes they do.
        Returns:
        true if this provider identifies creators.
      • isValid

        public boolean isValid​(String id)
        Description copied from interface: AuthenticationProvider
        Validates the syntax of an id.
        Parameters:
        id - the id to validate.
        Returns:
        true if id is well formed.