Skip to content

Faulty log message for Authority configuration #3676

@FrodeAtSea

Description

@FrodeAtSea

Microsoft.Identity.Web Library

Microsoft.Identity.Web

Microsoft.Identity.Web version

4.3.0

Web app

Sign-in users and call web APIs

Web API

Protected web APIs (validating tokens)

Token cache serialization

In-memory caches

Description

Log message

Microsoft.Identity.Web.MergedOptions [ 500 ]
 [MsIdWeb] Authority 'https://X.ciamlogin.com/X.onmicrosoft.com' is being ignored because Instance 'https://X.ciamlogin.com' and/or TenantId 'X.onmicrosoft.com' are already configured. 
To use Authority, remove Instance and TenantId from the configuration.

reported, even if there is no Instance and TenantId configured.

Reproduction steps

  1. Follow instructions to set up a Web App with Entra external Id (external tenant).
  2. Be sure the appsettings.json resemble
  "AzureAd": {
    "Authority": "https://X.ciamlogin.com/",
    "ClientId": "an id",
    "ClientCertificates": [
      {
        "SourceType": "StoreWithThumbprint",
        "CertificateStorePath": "CurrentUser/My",
        "CertificateThumbprint": "a thumbprint"
      }
    ],
    "ResponseType": "code",
    "CallbackPath": "/signin-oidc",
    "SignedOutCallbackPath": "/signout-callback-oidc"
  },

Error message

Id Web logs

Microsoft.Identity.Web.MergedOptions [ 500 ]
[MsIdWeb] Authority 'https://X.ciamlogin.com/X.onmicrosoft.com' is being ignored because Instance 'https://X.ciamlogin.com' and/or TenantId 'X.onmicrosoft.com' are already configured.
To use Authority, remove Instance and TenantId from the configuration.

Relevant code snippets

builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
         .AddMicrosoftIdentityWebApp(builder.Configuration.GetSection("AzureAd"))
         .EnableTokenAcquisitionToCallDownstreamApi() // required for Oidc Authorization Code flow
         .AddInMemoryTokenCaches();

Regression

No response

Expected behavior

No log message, or a log/error specifying the problem with Authority configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions