in src/oslogin_utils.cc [1213:1244]
bool StartSession(const string& email, string* response) {
bool ret = true;
json_object* jobj = NULL;
json_object* jarr = NULL;
jarr = json_object_new_array();
json_object_array_add(jarr, json_object_new_string(INTERNAL_TWO_FACTOR));
json_object_array_add(jarr, json_object_new_string(SECURITY_KEY_OTP));
json_object_array_add(jarr, json_object_new_string(AUTHZEN));
json_object_array_add(jarr, json_object_new_string(TOTP));
json_object_array_add(jarr, json_object_new_string(IDV_PREREGISTERED_PHONE));
jobj = json_object_new_object();
json_object_object_add(jobj, "email", json_object_new_string(email.c_str()));
json_object_object_add(jobj, "supportedChallengeTypes", jarr); // Ownership transferred to jobj.
const char* data;
data = json_object_to_json_string_ext(jobj, JSON_C_TO_STRING_PLAIN);
std::stringstream url;
url << kMetadataServerUrl << "authenticate/sessions/start";
long http_code = 0;
if (!HttpPost(url.str(), data, response, &http_code) || response->empty() ||
http_code != 200) {
ret = false;
}
json_object_put(jobj);
return ret;
}