You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 4-WebApp-your-API/4-1-MyOrg/README.md
+13-21Lines changed: 13 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -157,7 +157,7 @@ To manually register the apps, as a first step you'll need to:
157
157
1. Still on the same app registration, select the **Token configuration** blade to the left.
158
158
1. Select **Add optional claim**:
159
159
1. Select **optional claim type**, then choose **Access**.
160
-
1. Select the optional claim **idtyp**.
160
+
1. Select the optional claim **idtyp**. Indicates token type.This claim is the most accurate way for an API to determine if a token is an app token or an app+user token
161
161
1. Select **Add** to save your changes.
162
162
163
163
##### Configure the service app (TodoListService-aspnetcore-webapi) to use your app registration
@@ -167,8 +167,8 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
167
167
> In the steps below, "ClientID" is the same as "Application ID" or "AppId".
168
168
169
169
1. Open the `TodoListService\appsettings.json` file.
170
-
1. Find the key `Domain` and replace the existing value with your Azure AD tenant name.
171
-
1. Find the key `TenantId` and replace the existing value with your Azure AD tenant ID.
170
+
1. Find the key `Domain` and replace the existing value with your Azure AD tenant domain, ex. `contoso.onmicrosoft.com`.
171
+
1. Find the key `TenantId` and replace the existing value with your Azure AD tenant/directory ID.
172
172
1. Find the key `ClientId` and replace the existing value with the application ID (clientId) of `TodoListService-aspnetcore-webapi` app copied from the Azure portal.
173
173
174
174
#### Register the client app (TodoListClient-aspnetcore-webapi)
@@ -203,15 +203,23 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
203
203
1. In the **Delegated permissions** section, select the **ToDoList.Read**, **ToDoList.ReadWrite** in the list. Use the search box if necessary.
204
204
1. Select the **Add permissions** button at the bottom.
205
205
206
+
##### Configure Optional Claims
207
+
208
+
1. Still on the same app registration, select the **Token configuration** blade to the left.
209
+
1. Select **Add optional claim**:
210
+
1. Select **optional claim type**, then choose **ID**.
211
+
1. Select the optional claim **acct**. Provides user's account status in tenant.If the user is a member of the tenant, the value is 0. If they're a guest, the value is 1.
212
+
1. Select **Add** to save your changes.
213
+
206
214
##### Configure the client app (TodoListClient-aspnetcore-webapi) to use your app registration
207
215
208
216
Open the project in your IDE (like Visual Studio or Visual Studio Code) to configure the code.
209
217
210
218
> In the steps below, "ClientID" is the same as "Application ID" or "AppId".
211
219
212
220
1. Open the `Client\appsettings.json` file.
213
-
1. Find the key `Domain` and replace the existing value with your Azure AD tenant name.
214
-
1. Find the key `TenantId` and replace the existing value with your Azure AD tenant ID.
221
+
1. Find the key `Domain` and replace the existing value with your Azure AD tenant domain, ex. `contoso.onmicrosoft.com`.
222
+
1. Find the key `TenantId` and replace the existing value with your Azure AD tenant/directory ID.
215
223
1. Find the key `ClientId` and replace the existing value with the application ID (clientId) of `TodoListClient-aspnetcore-webapi` app copied from the Azure portal.
216
224
1. Find the key `ClientSecret` and replace the existing value with the key you saved during the creation of `TodoListClient-aspnetcore-webapi` copied from the Azure portal.
217
225
1. Find the key `TodoListScopes` and replace the existing value with **"api://<your_service_api_client_id>/ToDoList.Read api://<your_service_api_client_id>/ToDoList.ReadWrite"**.
@@ -519,14 +527,6 @@ Follow the link to [Publish with Visual Studio](https://docs.microsoft.com/visua
519
527
1. Install the Visual Studio Code extension [Azure App Service](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureappservice).
520
528
1. Follow the link to [Publish with Visual Studio Code](https://docs.microsoft.com/aspnet/core/tutorials/publish-to-azure-webapp-using-vscode)
> :warning: the following steps are required only if you want your web API to be consumed by a single-page application (SPA). Learn more on [cross-origin resource sharing](https://developer.mozilla.org/docs/Web/HTTP/CORS).
525
-
526
-
1. Go to [Azure portal](https://portal.azure.com), and locate your project there.
527
-
- On the API tab, select **CORS**. Check the box **Enable Access-Control-Allow-Credentials**.
528
-
- Under **Allowed origins**, add the site URL of your published website **that will call this web API**.
529
-
530
530
### Deploying web app to Azure App Services
531
531
532
532
There is one web app in this sample. To deploy it to **Azure App Services**, you'll need to:
@@ -564,14 +564,6 @@ In the left-hand navigation pane, select the **Azure Active Directory** service,
564
564
565
565
> :warning: If your app is using an *in-memory* storage, **Azure App Services** will spin down your web site if it is inactive, and any records that your app was keeping will emptied. In addition, if you increase the instance count of your website, requests will be distributed among the instances. Your app's records, therefore, will not be the same on each instance.
566
566
567
-
## Next Steps
568
-
569
-
Learn how to:
570
-
571
-
* [Change your app to sign-in users from any organization or Microsoft accounts](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/1-WebApp-OIDC/1-3-AnyOrgOrPersonal)
572
-
* [Enable users from National clouds to sign-in to your application](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/1-WebApp-OIDC/1-4-Sovereign)
573
-
* [Enable your web app to call a web API on behalf of the signed-in user](https://github.com/Azure-Samples/ms-identity-dotnetcore-ca-auth-context-app)
574
-
575
567
## Contributing
576
568
577
569
If you'd like to contribute to this sample, see [CONTRIBUTING.MD](/CONTRIBUTING.md).
0 commit comments