Reputation: 10452
Here's my situation:
knownClientApplications
array in the service app manifest.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
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.
Upvotes: 2