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

        complete = true;

        // Verify server-wide policy.
        if (!ENABLED.getValue())
        {
            throw new SaslException( "Authentication failed" );
        }

        // Verify that client can connect from his IP address.
        final Connection connection = session.getConnection();
        assert connection != null; // While the peer is performing a SASL negotiation, the connection can't be null.
        final boolean forbidAccess = !LocalClientSession.isAllowedAnonymous(connection);
        if ( forbidAccess )
        {
            throw new SaslException( "Authentication failed" );
        }

        // Just accept the authentication :)
        return null;
    }
Implementation of the SASL ANONYMOUS mechanism.

@author Guus der Kinderen, guus@goodbytes.nl
@see <a href="http://tools.ietf.org/html/rfc4505">RFC 4505</a>
@see <a href="http://xmpp.org/extensions/xep-0175.html">XEP 0175</a>
xmppserver/src/main/java/org/jivesoftware/openfire/sasl/AnonymousSaslServer.java