You are developing an ASP.NET Core Web API named InventoryAPI that exposes operations to manage warehouse inventory. You register InventoryAPI in Microsoft Entra ID. You need to configure permissions and scopes to support the following client applications:
1. InventorySPA: A Single Page Application where warehouse employees sign in and manage stock. The application must perform operations on behalf of the signed-in user.
2. InventoryDaemon: A background console application that syncs stock levels from an external system overnight. The daemon runs without user interaction.
Which two configurations should you perform to support these applications using the principle of least privilege?
- Expose a delegated scope named Inventory.ReadWrite in the API registration for InventoryAPI, and grant the InventorySPA application delegated permission to access this scope.Cevap
- Define an App Role named Inventory.ReadWrite.All in the API registration for InventoryAPI, and grant the InventoryDaemon application application permission to access this role.Cevap
- CExpose a delegated scope named Inventory.ReadWrite.All in the API registration for InventoryAPI, and grant the InventoryDaemon application delegated permission to access this scope.
- DDefine an App Role named Inventory.ReadWrite in the API registration for InventoryAPI, and grant the InventorySPA application application permission to access this role.
Cevap
Expose a delegated scope named Inventory.ReadWrite for the Single Page Application, and define an App Role named Inventory.ReadWrite.All for the daemon service.
The correct options are to expose a delegated scope for the browser-based Single Page Application (where employees sign in) and to define an App Role (application permission) for the background daemon service (which runs without user interaction).
Adım Adım Çözüm
Anahtar Kavram
Microsoft Entra ID distinguishes between Delegated permissions (used when a signed-in user is present) and Application permissions (used by background daemons or services without a signed-in user). API creators expose delegated permissions as scopes and application permissions as App Roles.