I have integrated OAuth 2.0 implicit grant flow within portal following this below document:
https://docs.microsoft.com/en-us/powerapps/maker/portals/oauth-implicit-grant-flow#register-client-id-for-implicit-grant-flow
but getting following error in my api while debugging:
{"xxxxxx: Audience validation failed. Audiences: ''. Did not match: validationParameters.ValidAudience: 'xxxxxxxxxxxxxxxxxx' or validationParameters.ValidAudiences: 'null'."}
I have added these site settings in my portal:
Connector/ImplicitGrantFlowEnabled to True
ImplicitGrantFlow/TokenExpirationTime to 3600
ImplicitGrantFlow/RegisteredClientId to Client ID (from azure AD app)
ImplicitGrantFlow/{ClientId}/RedirectUri to my portal page
I have integrated this following Token Endpoint JavaScript code in portal page:
https://github.com/microsoft/PowerApps-Samples/blob/master/portals/TokenEndpoint.js
and my azure hosted API code here:
https://github.com/microsoft/PowerApps-Samples/tree/master/portals/ExternalWebApiConsumingPortalOAuthTokenSample
What I have done wrong for which the above error is generating?