We have a .NET Core 3.1 app, usign ASP.NET Core Identity and IdentityServer4. We had a requirement to enable creating new users with special characters in their emails, for instance: sömêthìng@example.com
So, we set this option in Startup.cs
(I'm ignoring all other properties for now)
services.Configure<IdentityOptions>(options =>
{
options.User.AllowedUserNameCharacters = null;
});
And it worked, new users could be created.
However, I can not authenticate in the application.
The call to IS4 /connect/userinfo
is being successfull, returning the results:
The next call is to the endpoint users/getinfo
, but it throws a 502 - Bad Gateway and it only happens when the username/email has special characters (It's worth to mention that the application is not new and the authentication flow has been working fine until now).
The endpoint is not hit by the breakpoint and I could detect any middleware that could be causing this.
However, I noticed in the RequestHeaders > Cookie in Chrome:
The username seems to be encoded, I don't know. And I also don't know if that is the issue for the authentication, but it seems to be.
I also tried to call the endpoint via Postman and the issue is the same. I thought that maybe the token, somehow, could be encoded incorrectly, but it isn't, it's ok. Ah, and we're using Angular 12 as frontend.
Has anyone already faced something like this?