Hi Ej, according to your description, I'm afraid you already read the official document for adding Microsoft account as the external authentication provider. Here, I had a test in my side by creating a new blazor web app server side rendered, and choosing Individual Accounts as the Authentication type. Then I add code snippet .AddMicrosoftAccount
following the document to Program.cs which looks like below. Then I can get the result like the screenshot. Please note, the external authentication requires to use alone with the asp.net core default identity.
builder.Services.AddAuthentication(options =>
{
options.DefaultScheme = IdentityConstants.ApplicationScheme;
options.DefaultSignInScheme = IdentityConstants.ExternalScheme;
})
.AddIdentityCookies();
builder.Services.AddAuthentication()
.AddMicrosoftAccount(microsoftOptions =>
{
microsoftOptions.ClientId = "client_id";
microsoftOptions.ClientSecret = "client_secret";
});
Installing the Nuget package you mentioned can solve the issue, but didn't produce "Can't find the namespace App..." error message. I create the project like screenshot below. When it worked well, I can see external sign in entrance over there.
I also tried to add the code snippet in a project which doesn't have individual account authentication type, but installing the package can solve the no reference compilation error as well. So that I'm afraid there's some other differences between your code and mine. If you don't care why you had that error message after installing the nuget package, I suggest you creating a new project for test if possible.
You also mentioned that you want to add google authentication into blazor web app, if you want to do like what I shared above, you might follow the document here to integrate it. If you just want to have an app which only support Google account signing in, I'm afraid you could go to Google Authentication support team for help.