When I call Google APIs from an Azure website, I get 502 - Web server received an invalid response while acting as a gateway or proxy server. The exact code wor
I saw your question before, but didn't noticed the solution... I have it now also.. When generating the certificate add:
var certificate = new X509Certificate2(p12Path, "notasecret", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable);
//(notice the X509KeyStorageFlags.MachineKeySet |)
. Hi Colin Mierowsky
Where are you create certificate, in Application_Start, or WebApiConfig Register method ?
where use this code ?
makecert -r -n "CN=abdullahsargin.com, E=sargin48@gmail.com" -sky exchange -b 11/01/2015 -pe -sv myhost.pvk myhost.cer
pvk2pfx -pvk myhost.pvk -spc myhost.cer -pfx myhost.pfx -po Test.123
In global.asax application_start
try
{
var certFile = Server.MapPath("~/App_Data/myhost.pfx");
var cert = new X509Certificate2(certFile, "Test.123",
X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable);
}
catch (Exception exc)
{
_tools.LogError(exc);
}
. this method running success on local but in azure get 502 on this code, i test this method row and row
var code = await _userManager.GeneratePasswordResetTokenAsync(user.Id);
complete of this method
[HttpGet, AllowAnonymous]
public async Task<HttpResponseMessage> ForgotPassword([FromUri] ForgotPasswordViewModel model)
{
try
{
var code = await _userManager.GeneratePasswordResetTokenAsync(user.Id);
return Request.CreateResponse(HttpStatusCode.OK, new { model = user });
var url = "http://abdullahsargin.com#/account/resetPassword/" + user.Id + "/" + code;
await _userManager.SendEmailAsync(user.Id, "Reset Password",
"Please reset your password by clicking here: <a href=\"" + url + "\">link</a>");
return Request.CreateResponse(HttpStatusCode.OK);
}
catch (Exception exc)
{
MyTools.LogError(exc.GetBaseException());
return Request.CreateResponse(HttpStatusCode.BadRequest, exc.GetBaseException());
}
}
i find at this page my solution
ASP.NET Identity: use GeneratePasswordResetToken on Azure website
for my solution
public UserManager() : base(new UserStore<ApplicationUser>(new MyDbContext()))
{
// other setup
this.UserTokenProvider = new TotpSecurityStampBasedTokenProvider<ApplicationUser, string>();
}