Describe the bug
Add external login to a logged in user will throw InvalidOperationException if the external login is already connected to another existing account.
To Reproduce
Steps to reproduce the behavior:
- Using this version of ASP.NET Core '3.0.100-preview4-011223'.
- Create a new Web Application MVC with Identity enabled.
- Execute database migration to create the identity db.
- Configure one or more valid external login in Startup.cs (Google, Facebook…).
- Add all Identity Views with scaffolding.
- Run the website and register a user with username and password.
- After login in the profile page -> 'External Logins' connect one external login to the current account.
- Logout and register a second user with new credential.
- After login go to the profile page -> 'External Logins' and try to connect the same external login to this second account.
- The app will throw:
InvalidOperationException: Unexpected error occurred adding external login for user with ID '...'. MultipleIdentity.Server.Areas.Identity.Pages.Account.Manage.ExternalLoginsModel.OnGetLinkLoginCallbackAsync() in ExternalLogins.cshtml.cs, line 102
Expected behavior
Anything except an exception.
Screenshots

Done
area-identity
bug
identity-UI