Tom Studee
Tom Studee

Reputation: 10452

Receiving Failure message: IDX10214: Audience validation failed. when trying to authenticate a client App to a service App

Here's my situation:

When trying to access an endpoint with the token retrieved by the client I'm seeing the following error in the debug output of my service:

Failure message: IDX10214: Audience validation failed. Audiences: 'client App ID'. Did not match: validationParameters.ValidAudience: 'service App ID' or validationParameters.ValidAudiences: 'null'.

I suspect that if I were to ditch the client App ID and just use the service App ID in the client as well things would probably work fine, but that doesn't seem correct.

Should I just set validationParameters.ValidAudiences? If so, how do I do that? The pertinent section of my startup.cs shows:

services.AddAuthentication(AzureADDefaults.BearerAuthenticationScheme)
        .AddAzureADBearer(options => Configuration.Bind("AzureAD", options));

Or, is there something I need to change in my client-side msal-angular configuration to tell it I need the token audience to reflect my service app id?

Upvotes: 1

Views: 5708

Answers (1)

Tony Ju
Tony Ju

Reputation: 15629

The scope in you client web application should be Application ID URL/.default

api://691af574-47f6-4b8e-b544-b75ec4387938/TodoListService/.default

You can find this in web api application.

enter image description here

Upvotes: 2

Related Questions