One client credential type required either

Summary

I got this error recently when I forgot to add a Client Secret to my appsettings.json file.

One client credential type required either: ClientSecret, Certificate, ClientAssertion or AppTokenProvider must be defined when creating a Confidential Client. Only specify one. See https://aka.ms/msal-net-client-credentials.

This usually happens when the ClientID is missing from the appsettings.json.

  "AllowedHosts": "*",
  "AzureAdB2C": {
    "Instance": "https://<domain>.b2clogin.com/",
    "Domain": "<domain>.onmicrosoft.com",
    "TenantId": "000000-0000-4784-0000-0000000",
    "ClientId": "000000-0000-40ad-91e2-0000000",
    "CallbackPath": "/signin-oidc",
    "SignUpSignInPolicyId": "B2C_1_susi"
  }
  "AllowedHosts": "*",
  "AzureAdB2C": {
    "Instance": "https://<domain>.b2clogin.com/",
    "Domain": "<domain>.onmicrosoft.com",
    "TenantId": "000000-0000-4784-0000-0000000",
    "ClientSecret": "v3X8Q~nddkksieXpFj_ByqaJyN5SuHHtFdEWAss",
    "ClientId": "000000-0000-40ad-91e2-0000000",
    "CallbackPath": "/signin-oidc",
    "SignUpSignInPolicyId": "B2C_1_susi"
  }