Infrastructure for authentication using referrals