79380173

Date: 2025-01-23 07:35:28
Score: 0.5
Natty:
Report link

ASP.Net Identity will not allow you to have multiple users with same username for sure. Reason: username is the only parameter which Identity management uses to retrieve remaining user details.

As a workaround, I can suggest having dropdown/search-box to select client/company first and then enter username while registering user into system. And, store username by concatinating client code/id to username to make it unique. e.g. assume company code is 000001 and username is jone_doe. username can be stored as john_doe_000001. For another client,john_doe_000002.

While performing authentication, let user select, client/company(000001) and then enter username (john_doe) and password on login page. While passing credentials to Identity management, again you can concat, client code and username together. i.e. john_doe_000001.

From CX POV, some workarounds can be done like having different subdomain/login pages for each client which will save client's efforts of manually selecting/searching client. Or Hidden field, query parameter, you can choose your own state management technique depending on your app behaviours considering how user lands on your login page.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Kiran Sarode