First of all, you are missing two important fields :) If you look at HTML, there are two additional fields in the form - IDToken1(this is the username) and IDToken2(this is the password).
If you pass them into a POST request, you must return some cookies, which can then be used on subsequent requests. They identify you as a registered user.
Of course, I cannot fully verify this, since I do not have a valid login, but here is the beginning:
class VerizonLogin
{
CookieContainer Cookies = new CookieContainer();
void Main()
{
Login("test","testpass");
}
void Login(string username, string password)
{
var wr = (HttpWebRequest)WebRequest.Create("https://login.verizonwireless.com:443/amserver/UI/Login");
wr.Method = "POST";
wr.ContentType = "application/x-www-form-urlencoded";
wr.Referer = "https://login.verizonwireless.com/amserver/UI/Login";
wr.CookieContainer = Cookies;
var parameters = new Dictionary<string,string>{
{"realm", "vzw"},
{"goto",""},
{"gotoOnFail",""},
{"gx_charset", "UTF-8"},
{"rememberUserNameCheckBoxExists","Y"},
{"IDToken1", username},
{"IDToken2", password}
};
using (var requestStream = wr.GetRequestStream())
using (var writer = new StreamWriter(requestStream,Encoding.UTF8))
writer.Write(ParamsToFormEncoded(parameters));
using (var response = (HttpWebResponse)wr.GetResponse())
{
}
}
string ParamsToFormEncoded(Dictionary<string,string> parameters)
{
return string.Join("&", parameters.Select(kvp =>
Uri.EscapeDataString(kvp.Key).Replace("%20","+") + "=" + Uri.EscapeDataString(kvp.Value).Replace("%20","+")
).ToArray());
}
}
source
share