I am trying to use globalization in my Asp.NET Identity specifically in TokenEndpointPath.
My dll versions are the following:
Microsoft.AspNet.Identity.Core - 2.0.0.0
Microsoft.AspNet.Identity.EntityFramework - 2.0.0.0
Microsoft.AspNet.Identity.Owin - 2.0.0.0
Microsoft.Owin - 3.0.1.0
For each of them I download also the pt-BR localization:
<package id="Microsoft.AspNet.Identity.Core.pt-br" version="2.2.1" targetFramework="net452" /><package id="Microsoft.AspNet.Identity.EntityFramework.pt-br" version="2.2.1" targetFramework="net452" /><package id="Microsoft.AspNet.Identity.Owin.pt-br" version="2.2.1" targetFramework="net452" /><package id="Microsoft.Owin.pt-br" version="3.0.1" targetFramework="net452" />
And I added the following line in my
web.config:
<system.web><globalization culture="pt-BR" uiCulture="pt-BR"/></system.web>
I am also using restSharp or Postman to make a few endpoints calls trying to force pt-BR language usage.
public async TaskInvalidPasswordLoginTest(){Lessor lessor; using (ApplicationUserManager userManager =UserManager){ lessor =newLessor{Name="Master and Commander Lessor",Email="master-lessor@email.com",UserName="master-lessor@email.com"}; await userManager.CreateAsync(lessor,"passwd1");}#region Execute Test Actions//Autenticate Uservar request =newRestRequest("/Token",Method.POST); request.AddParameter("grant_type","password"); request.AddParameter("password","passwd12"); request.AddParameter("username", lessor.UserName); request.AddHeader("Content-Type","application/x-www-form-urlencoded");IRestResponse response =Client.Execute(request);Assert.That(response.StatusCode,Is.EqualTo(HttpStatusCode.BadRequest));#endregion}
But my response is has the following content:
"{\"error\":\"invalid_grant\",\"error_description\":\"The user name or password is incorrect.\"}"
Instead of the pt-BR version. Is this supposed to happen? Any idea of what I might be doing wrong?