Hi @Raymond Knetemann ,
Thank you for posting your query on Microsoft Q&A. I am Saiteja from Q&A will be assisting you with your query.
Based on your query, I understand you would like to call two scopes in single call to avoid multiple interactions.
You can configure two applications in Azure App registrations and make one as an API and add it to the other application. In order to perform this, please follow the document mentioned here.
- Sign in to the Microsoft Entra admin center as at least a Cloud Application Administrator.
- If you have access to multiple tenants, use the Settings icon
in the top menu to switch to the tenant containing the app registration from the Directories + subscriptions menu.
- Perform the steps in register an application and skip the Redirect URI (optional) section. You don't need to configure a redirect URI for a web API since no user is logged in interactively.
At the place of scope in the specified document, provide the required scope for your application.
First, follow these steps to create an example scope named Employees.Read.All
:
Select Expose an API.
At the top of the page, select Add next to Application ID URI. This defaults to api://<application-client-id>
. The App ID URI acts as the prefix for the scopes you'll reference in your API's code, and it must be globally unique. Select Save.
Select Add a scope:
Once you have successfully added the scope, you will see that in this format: https://contoso.com/api/Employees.Read.All
Now you need to register the application same as register an application . Once the application is registered, Select API permissions, then Add a permission and select My APIs in the sidebar. Now you will see your previous registration as exposed API in this format: https://contoso.com/api/Employees.Read.All. Add the other permissions required to your application and provide the admin consent for the application permissions. See the attached screenshot:
Once the consent has been provided, you can try retrieving the token for the same application with two different scopes in the application.
I hope this information is helpful. Please feel free to reach out if you have any further questions.
If the answer is helpful, please click "Accept Answer" and kindly "upvote it". If you have extra questions about this answer, please click "Comment"