Why you see aud = https://apihub.azure.com
When you create a connection to a custom connector, the client (Power Apps / Power Automate / Copilot Studio) first acquires an access token for the connector runtime (aka “apihub”). That token’s audience is not your API, it’s the Power Platform connector host (apihub). The connector runtime then performs the OBO exchange server‑side to obtain a second token targeted at your downstream API and forwards that token to your API in the Authorization header when it calls your backend. In other words, the token you’re decoding is only the first hop token.
You can even see clues to this in some error payloads and headers from connector calls (x‑ms‑apihub‑obo: true) indicating OBO is in play behind the scenes.
Don’t validate the connection token you get from the Test UI or your browser dev tools. Validate the token that your API actually receives from the connector call.
High level - minimal checklist to get to a working OBO flow
1) Service app reg (your API)
Expose an API → set Application ID URI (e.g., api://…)
Add at least one scope or app role.
2) Connector app reg (the connector)
Grant API permissions (to your service app) → admin consent
(If calling Graph, add the Graph scopes/roles as well.)
3) Custom connector (Security tab)
Identity provider: Microsoft Entra ID (OAuth 2.0)
Authorize/Token: …/oauth2/v2.0/authorize & …/oauth2/v2.0/token
Resource URL: your API’s App ID URI
Scope: api://…/.default
OBO: Enabled.
4) Test end‑to‑end by hitting your API and decoding the token received by your API—its aud should be your App ID URI. (Don’t rely on the apihub token you see during connection.)
✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
👍 Feel free to Like the post if you found it useful.