Search code examples
asp.net-coreasp.net-web-apimicrosoft-identity-platformmicrosoft-identity-web

What are the actual configuration options when calling AddMicrosoftIdentityWebApi(IConfiguration.GetSection());


I am calling the Microsoft.Identity.Web.MicrosoftIdentityWebApiAuthenticationBuilderWithConfiguration AddMicrosoftIdentityWebApi.AddMicrosoftIdentityWebApi(IConfiguration.GetSection()) to setup authentication/authorization of an Azure Function, but have not been able to find the actual specification for the configuration settings i can feed to the method, e.g available keys, required / optional, value constraints etc?

I've found these 3 MS docs:

The first two use these options:

  • "Instance"
  • "ClientId"
  • "Domain"
  • "SignedOutCallbackPath"
  • "SignUpSignInPolicyId"

The third adds this to the party:

  • "EditProfilePolicyId"
  • "ClientSecret"
  • "TodoListScope" ? seems scoped to the demo application TodoList ?
  • "ResetPasswordPolicyId"

but does not mention "SignedOutCallbackPath"

chatGPT offers two more, unconfirmed, candidates:

  • "CallbackPath"
  • "ApiScopes:0"

Can someone guide me to the actual MS official documentation of this specification, as the linked documentation seems somewhat superficial on the subject of this question, to say at least.

To paraphrase point 34 from The Pragmatic Programmer: "Don't Assume It - Prove It".
Currently I am blindly assuming ;)


Solution

  • I think there's some confusion between:

    AddMicrosftIdentityWebApi and AddMicrosoftIdentityWebApp.

    The former (as mentioned in your question) uses JwtBearerOptions but those properties listed in your question are part of MicrosoftIdentityOptions as used by the latter.

    The full list of properties can be found in the source code of MicrosoftIdentityOptions.