If you have an Azure subscription, then I would recommend using Azure AD B2C. This allows you to create an Azure AD instance specifically for your app(s). They support Azure AD accounts and you can configure additional identity providers like Google, Facebook, MS Personal Account (outlook.com), Linkedin, etc.
It allows you to define custom profile properties in the portal and enabled you to configure the layout / experience for 'New User SignUp', 'Edit My Profile', 'Password Reset', and others.
If you're using Azure AD B2C and ASP.NET Identity in your application, you do not need to sign-up a user yourself. However, if you want access to a new user's data or claims after sign-up, you should be able to access it by modifying the AccountController.cs
In my AccountController.cs
:
public void SignUpSignIn(string redirectUrl = "")
{
// this redirect url is where the user is routed after authentication.
var default_redirectUrl = "/account/gateway";
if (string.IsNullOrWhiteSpace(redirectUrl))
{
redirectUrl = default_redirectUrl;
}
// Use the default policy to process the sign up / sign in flow
HttpContext.GetOwinContext().Authentication.Challenge(new AuthenticationProperties { RedirectUri = redirectUrl });
return;
}
// this is where the user is redirected after sign-up
public async Task<ActionResult> Gateway()
{
// if you cast the User.Identity as
// System.Security.Claims.ClaimsIdentity then you can access
// the claims from the identity provider.
var userClaims = (User.Identity as ClaimsIdentity).Claims;
var issuer_claim = userClaims.FindClaim("iss")?.Value;
var nameid_claim = userClaims.FindClaim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier")?.Value;
var audience_claim = userClaims.FindClaim("aud")?.Value;
var auth_time_claim = userClaims.FindClaim("auth_time")?.Value;
var idprovider_claim = userClaims.FindClaim("http://schemas.microsoft.com/identity/claims/identityprovider")?.Value;
var displayname_claim = userClaims.FindClaim("name")?.Value;
var objectid_claim = userClaims.FindClaim("http://schemas.microsoft.com/identity/claims/objectidentifier")?.Value;
var country_claim = userClaims.FindClaim("country")?.Value;
var newUser_claim = userClaims.FindClaim("newUser")?.Value;
var emails_claim = userClaims.FindClaim("emails")?.Value;
// Then you can use this claims as needed.
// after this navigate to your homepage or whatever makes sense.
return RedirectToAction("Index", "Home");
}
I hope this helps.
Link / More Info: https://azure.microsoft.com/en-us/services/active-directory/external-identities/b2c/