Reputation: 91
Unable to authenticate against a backend api using Azure. Error says invalid audience but the aud claim had the backend api client id when troubleshooting in jwt.ms.
Upvotes: 5
Views: 24690
Reputation: 9559
From your error report, it is indeed a 401 error, that is, your audience does not match the api you want to call, but your parsing token aud
claims to have the backend api client ID, so I think your authentication There may be a problem with the configuration, I use the auth code flow to do a simple demonstration for you:
Next,under 'API permissions', give your front-end application access to your backend api:
Get token:
Parse the token:
Upvotes: 3