I did this by changing these two lines in the AccountController template (forgive the rough code),
Old:
var user = new ApplicationUser { UserName = model.Email, Email = model.Email, Hometown = model.Hometown };
var result = await UserManager.CreateAsync(user);
New
var user = new ApplicationUser { UserName = info.Email, Email = info.Email, Hometown = model.Hometown };
IdentityResult result = null;
if (!allowedUsers.Contains(info.Email))
{
result = IdentityResult.Failed("User is not in permitted list");
}
else
{
result = await UserManager.CreateAsync(user);
}
, ( ) OAuth Startup.Auth , Scope, info.Email null:
app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
{
ClientId = "",
ClientSecret = "",
Scope = { "email" }
});
OAuth , , Microsoft names email "wl.emails" Scope MicrosoftAccountAuthenticationOptions.