A cloud-based identity and access management service for securing user authentication and resource access
Hi @Francesco Bruni , the OBO flow is used when a middle-tier web API needs to call another web API on behalf of the user as follows:
- The user signs in to the client application and obtains an access token.
- The client application sends the access token to the middle-tier web API.
- The middle-tier web API uses the access token to request a new access token from Azure AD for the downstream web API.
- Azure AD validates the access token and issues a new access token for the downstream web API.
It looks like you are skipping step 2 and using the access token obtained by the client application to request a new access token for the downstream web API. This won't work because the access token obtained by the client application is not a valid token for the downstream API.
You need to pass the access token obtained by the client application to the middle-tier web API and use it to request a new access token for the downstream web API. The new access token will be valid for the downstream web API because it was obtained on behalf of the user.
You also need to make sure that the access token obtained by the client application has the necessary scopes to call the middle-tier web API and that the new access token requested has the necessary scopes to call the downstream API.
Please let me know if you have any questions and I can help you further.
If this answer helps you please mark "Accept Answer" so other users can reference it.
Thank you,
James