public function beforeAuthenticate(
        \Magento\Customer\Model\AccountManagement $subject,
        $username,
        $password
    ) {
        try {
            $mlmId = trim($username);
            $found = $this->daoDwnlCust->getByMlmId($mlmId);
            if ($found) {
                $custId = $found->getCustomerRef();
                $customer = $this->daoCust->getById($custId);
                if ($customer instanceof \Magento\Customer\Api\Data\CustomerInterface) {
                    $username = $customer->getEmail();
                }
            }
        } catch (\Throwable $e) {
            /* stealth exceptions */
        }
        return [$username, $password];
    }
public function beforeAuthenticate(
        \Magento\Customer\Model\AccountManagement $subject,
        $username,
        $password
    ) {
        try {
            $mlmId = trim($username);
            $found = $this->daoDwnlCust->getByMlmId($mlmId);
            if ($found) {
                $custId = $found->getCustomerRef();
                $customer = $this->daoCust->getById($custId);
                if ($customer instanceof \Magento\Customer\Api\Data\CustomerInterface) {
                    $username = $customer->getEmail();
                }
            }
        } catch (\Throwable $e) {
            /* stealth exceptions */
        }
        return [$username, $password];
    }
public function beforeAuthenticate ( \ Magento \ Customer \ Model \ AccountManagement $ subject , $ username , $ password ) { try { $ mlmId = trim ( $ username ) ; $ found = $ this -> daoDwnlCust -> getByMlmId ( $ mlmId ) ; if ( $ found ) { $ custId = $ found -> getCustomerRef ( ) ; $ customer = $ this -> daoCust -> getById ( $ custId ) ; if ( $ customer instanceof \ Magento \ Customer \ Api \ Data \ CustomerInterface ) { $ username = $ customer -> getEmail ( ) ; } } } catch ( \ Throwable $ e ) { /* stealth exceptions */ } return [ $ username , $ password ] ; }
Look up for customer's email by MLM ID on authentication.

@param \Magento\Customer\Model\AccountManagement $subject
@param $username
@param $password
@return array
Look up for customer s email by MLM ID on authentication .