I'm trying to have a user sign in with local account and then sign up with a social account so that I can link the two together in my own database. That way, later they could use B2C and login with either local or social providers and end up with the same account in my system.
The trick seems to be securely communicating information from the signed in local user (like my database id for that user) to the sign up process for the social provider so that it can come back in the claims for the new user.
I thought about adding it to the RedirectUrl of the AuthenticationOptions but I can't work out how insecure that might be. If that endpoint was protected by an [Authorize] attribute, then a user would have to be authenticated before calling it.
It seems like it wouldn't be safe to add the database id of the local user into the redirect. Even though the user would be authenticated, a stolen token and a modified query string would like the wrong accounts.
Is there a way to make data roundtrip through the B2C process?
{EDIT} Forgot to mention this is a web app. Native client I understand how to save the token.