You cannot use the same authorization code more than once to get the access token for multiple API's. I suggest you can register your web api's as a single application registration with a single redirect url and access to those web api's can be managed using the scopes. You can refer to Tutorial: Grant access to an ASP.NET web API using Azure Active Directory B2C to understand how to configure the API scopes and grant access for them.
How to get multiple access tokens for several web api from one web application - AzureAD B2C
We have a web application which needs authenticated access to several Web APIs. We are using Azure AD B2C for authentication.
We receive an access token, id token, and refresh token for our first web api during login, but we are unable to get a second access token for another webapi.
The web application has given permission to both the webapi in the B2C portal.
The second /token call doesnt fail but the Access token is missing and the scopes are wrong.
Should this be possible?
2 answers
Sort by: Most helpful
-
Saurabh Sharma 23,816 Reputation points Microsoft Employee
2020-02-04T00:53:26.273+00:00 -
Vivek Kumar 1 Reputation point
2020-06-25T08:33:34.637+00:00 I hope the below link helps
https://upskillwithvivek.blogspot.com/2020/06/access-tokens-for-several-web-api-from.html -