Microsoft Azure Developer Associate AZ-204 Practice Question

Your team is building an ASP.NET Core 6 Web API that will be secured by the Microsoft Identity platform. The API must respond with HTTP 401 when no bearer token is present and with HTTP 403 when the token does not contain the access_as_user scope. Which Program.cs configuration meets these requirements?

  • Call AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddMicrosoftIdentityWebApi(configuration.GetSection("AzureAd")); then add an authorization policy that requires the access_as_user scope.

  • Call AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme).AddMicrosoftIdentityWebApp(configuration.GetSection("AzureAd")) and enable PKCE.

  • Call AddMicrosoftIdentityWebApiAuthentication(configuration, "AzureAd") and set JwtBearerOptions.SuppressMapInboundClaims = true without configuring extra policies.

  • Call AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(options => ); do not add additional authorization policies.

Microsoft Azure Developer Associate AZ-204
Implement Azure security
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot