diff --git a/aspnetcore/blazor/security/blazor-web-app-with-oidc.md b/aspnetcore/blazor/security/blazor-web-app-with-oidc.md index d30672fd16a4..3c7557eabfc8 100644 --- a/aspnetcore/blazor/security/blazor-web-app-with-oidc.md +++ b/aspnetcore/blazor/security/blazor-web-app-with-oidc.md @@ -317,20 +317,30 @@ The following ): The `Weather.Get` scope is configured in the Azure or Entra portal under **Expose an API**. This is necessary for backend web API project (`MinimalApiJwt`) to validate the access token with bearer JWT. ```csharp - oidcOptions.Scope.Add("{SCOPE}"); + oidcOptions.Scope.Add("{APP ID URI}/{API NAME}"); ``` - Example (`{SCOPE}`): + Example: + + * App ID URI (`{APP ID URI}`): `https://{DIRECTORY NAME}.onmicrosoft.com/{CLIENT ID}` + * Directory Name (`{DIRECTORY NAME}`): `contoso` + * Application (Client) Id (`{CLIENT ID}`): `4ba4de56-9cef-45d9-83fa-a4c18f9f5f0f` + * Scope configured for weather data from `MinimalApiJwt` (`{API NAME}`): `Weather.Get` ```csharp oidcOptions.Scope.Add("https://contoso.onmicrosoft.com/4ba4de56-9cef-45d9-83fa-a4c18f9f5f0f/Weather.Get"); ``` - The preceding example uses: + The preceding example pertains to an app registered in a tenant with an AAD B2C tenant type. If the app is registered in an ME-ID tenant, the App ID URI is different, thus the scope is different. + + Example: + + * App ID URI (`{APP ID URI}`): `api://{CLIENT ID}` with Application (Client) Id (`{CLIENT ID}`): `4ba4de56-9cef-45d9-83fa-a4c18f9f5f0f` + * Scope configured for weather data from `MinimalApiJwt` (`{API NAME}`): `Weather.Get` - * Directory name: `contoso` - * Client Id: `4ba4de56-9cef-45d9-83fa-a4c18f9f5f0f` - * Scope configured for weather data from `MinimalApiJwt`: `Weather.Get` + ```csharp + oidcOptions.Scope.Add("api://4ba4de56-9cef-45d9-83fa-a4c18f9f5f0f/Weather.Get"); + ``` * and : Sets the Authority and Client ID for OIDC calls. @@ -491,15 +501,28 @@ Configure the project in the : Sets the Authority for making OpenID Connect calls. Match the value to the Authority configured for the OIDC handler in `BlazorWebAppOidc/Program.cs`: