Added authenticate function for tenant model