SecurityTokenInvalidAudienceException is thrown unnecessarily? #1876
Unanswered
Deleted user (ghost)
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Not sure if i just have missconfigured or missunderstood how to secure my WebApi for two different schemas. I have tried to follow the steps explained in your wiki here: https://github.com/AzureAD/microsoft-identity-web/wiki/Multiple-Authentication-Schemes
It works, but my api seems to be throwing an unnecessary exception that is getting logged in our ApplicationInsight in Azure.
This is my basic setup:
Appconfig:
I have one schema for one client and another for a sepparate client (Both are App registration in our Azure Ad)
In my startup i have configured it like this:
The controller i have is configured to AUthorize both schemas:
The method endpoint is looking like this
I am triggering the endpoint from Postman with a token looking like this:
I get a Http status 200 and everything seems to be working. But the library internally is throwing an error like this:
So it is throwing an exception saying the token i am using that have audience ending with ...85 does not match the audience ending with ...22c. And that part is the one that does not make sense to me. But maybe i have missed something. Or maybe it is a bug? Just though i raise the question here.
All reactions