You are developing a secure client-side Single Page Application (SPA) named OrderClient and a backend Web API named OrderProcessor. The OrderClient application must make HTTP requests to OrderProcessor to retrieve order history on behalf of the currently signed-in user. You need to configure the Microsoft Entra ID app registrations for both applications to secure the API calls using OAuth 2.0. Which of the following configurations should you implement?
- In the OrderProcessor app registration, configure the Application ID URI to api://<OrderProcessor-ClientId>, expose a delegated scope named Orders.Read, and in the OrderClient app registration, add the delegated permission api://<OrderProcessor-ClientId>/Orders.Read.Cevap
- BIn the OrderProcessor app registration, generate a Shared Access Signature (SAS) token scoped to Orders.Read, and store this token in the OrderClient application configuration to authorize all user-delegated API requests.
- CEnable a system-assigned managed identity for the App Service hosting OrderClient, and configure OrderProcessor to grant access to the managed identity's service principal using an Application permission.
- DIn the OrderProcessor app registration, configure the Application ID URI, expose an Application permission (App Role) named Orders.Read, and configure the OrderClient app registration to use the delegated permission api://<OrderProcessor-ClientId>/.default.
Cevap
Configuring a delegated scope on the backend Web API registration and granting it as a delegated permission to the SPA registration.
Configuring a delegated scope on the backend Web API and granting it to the SPA registration correctly enforces OAuth 2.0 delegated authorization. Using the Application ID URI prefix ensures the scope is globally unique in Microsoft Entra ID, allowing the client application to obtain tokens specifically for that resource.
Adım Adım Çözüm
Anahtar Kavram
Microsoft Entra ID Delegated Permissions and Custom API Scopes