Hi @Greg Gum ,
Thanks for reaching out.
I understand you are trying to configure ASP.Net Blazor WebAssembly app with Azure Active Directory B2C and facing issues.
The error you are getting is due to your application's configuration has not been set up properly to recognize B2C policies.
If you are calling the protected Web API, AddMicrosoftIdentityWebApi method in startup.cs configures services to protect the web API which expects an AzureAdB2C section in the app's configuration with the necessary settings to initialize authentication options.
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApi(Configuration.GetSection("AzureAdB2C"));
To configure the Blazor Server, you need to specify SignUp or SignIn Policy in your Azure AD B2C configration in appsettings.json file
{
"AzureAdB2C": {
"Instance": "https://{TENANT}.b2clogin.com/",
"ClientId": "{SERVER API APP CLIENT ID}",
"Domain": "{TENANT DOMAIN}",
"SignUpSignInPolicyId": "{SIGN UP OR SIGN IN POLICY}"
}
}
However, to configure WebAssembly Client application using Azure AD B2C, appsettings.json of client application must include authority in configration files as:
{
"AzureAdB2C": {
"Authority": "{AAD B2C INSTANCE}{TENANT DOMAIN}/{SIGN UP OR SIGN IN POLICY}",
"ClientId": "{CLIENT APP CLIENT ID}",
"ValidateAuthority": false
}
}
Please find the reference to configure WebAssembly which is supported Azure AD B2C as mentioned here for more details.
Hope this will help.
Thanks,
Shweta
----------------------------
Please remember to "Accept Answer" if answer helped you.