public boolean authenticate(String digest) {
        // Perform authentication. Wait for the handshake (with the secret key)
        String anticipatedDigest = AuthFactory.createDigest(getStreamID().getID(), ConnectionMultiplexerManager.getDefaultSecret());
        // Check that the provided handshake (secret key + sessionID) is correct
        if (!anticipatedDigest.equalsIgnoreCase(digest)) {
            Log.debug("LocalConnectionMultiplexerSession: [ConMng] Incorrect handshake for connection manager with domain: {}", getAddress().getDomain());
            // The credentials supplied by the initiator are not valid (answer an error and close the connection)
            conn.close(new StreamError(StreamError.Condition.not_authorized));
            return false;
        }
        else {
            // Component has authenticated fine
            setStatus(Session.Status.AUTHENTICATED);
            // Send empty handshake element to acknowledge success
            conn.deliverRawText("<handshake></handshake>");
            Log.debug("LocalConnectionMultiplexerSession: [ConMng] Connection manager was AUTHENTICATED with domain: " + getAddress());
            sendClientOptions();
            return true;
        }
    }
Authenticates the connection manager. Shared secret is validated with the one provided
by the connection manager. If everything went fine then the session will have a status
of "authenticated" and the connection manager will receive the client configuration
options.

@param digest the digest provided by the connection manager with the handshake stanza.
@return true if the connection manager was sucessfully authenticated.
xmppserver/src/main/java/org/jivesoftware/openfire/session/LocalConnectionMultiplexerSession.java