@Override
    public byte[] evaluateResponse( byte[] response ) throws SaslException
    {
        if ( isComplete() )
        {
            throw new IllegalStateException( "Authentication exchange already completed." );
        }

        if ( response == null || response.length == 0 )
        {
            // No info was provided so send a challenge to get it.
            return new byte[ 0 ];
        }

        complete = true;

        // Parse data and obtain username & password.
        final StringTokenizer tokens = new StringTokenizer( new String( response, StandardCharsets.UTF_8 ), "\0" );
        tokens.nextToken();
        final String secretDigest = tokens.nextToken();

        if ( authenticateSharedSecret( secretDigest ) )
        {
            return null; // Success!
        }
        else
        {
            // Otherwise, authentication failed.
            throw new SaslException( "Authentication failed" );
        }
    }
Implementation of a proprietary Jive Software SASL mechanism that is based on a shared secret. Successful
authentication will result in an anonymous authorization.

@author Guus der Kinderen, guus@goodbytes.nl
xmppserver/src/main/java/org/jivesoftware/openfire/sasl/JiveSharedSecretSaslServer.java