[MINOR_ISSUE] Azure AD Integration error

I have…

  • [ X] Checked the logs and have uploaded a log file and provided a link because I found something suspicious there. Please do not post the log file in the topic because very often something important is missing.

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [ X] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

Squidex inside Kubernetes, configured to authenticate with Azure AD, so added Microsoft Client Id, Secret, and Tenant ID. Authentication is performed but blocked at the last stage, when the user is added to identity users. At this point an error is recorded and the browsers redirects again to login page. This is the logged error: “InvalidUserName: User name \u0027username_abcdefdomain#EXT#@abcdefdomain.onmicrosoft.com\u0027 is invalid, can only contain letters or digits.”
This error is correct because ASP:NET Core Identity is configured to accept only alphanumeric letters for user names, but is not the desired behavior.

Expected behavior

Login completes with success, and complex username is accepted (because Azure AD in some circumstances provides complex/combined data as user name claim).

Minimal reproduction of the problem

Register an app in Azure Active Directory App Registration (for Default Directory), and configure squidex to use the provided Client ID, Secret, and Tenant ID. Then try to login to squidex using an account of default directory of the organization registered in Azure AD.

Environment

  • [X ] Self hosted with docker and Kubernetes
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: 4.5.1

Browser:

  • [ ] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [X ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:
LogFile: log.txt

I see, PR is welcome. It has very little priority for me.