Skip to content

Commit 9280e04

Browse files
authored
Merge pull request #252690 from MicrosoftDocs/main
Publish to live, Monday 4 AM PST, 9/25
2 parents a42f34d + b2dfc32 commit 9280e04

File tree

222 files changed

+621
-614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+621
-614
lines changed

articles/active-directory/develop/howto-add-app-roles-in-apps.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.service: active-directory
99
ms.subservice: develop
1010
ms.workload: identity
1111
ms.topic: how-to
12-
ms.date: 09/27/2022
12+
ms.date: 09/25/2023
1313
ms.author: cwerner
1414
ms.reviewer: kkrishna, jmprieur
1515
ms.custom: aaddev
@@ -73,30 +73,9 @@ If you have not already done so, you'll need to assign yourself as the applicati
7373
>
7474
> Ensure that both the API application and the application you want to add permissions to both have an owner, otherwise the API will not be listed when requesting API permissions.
7575
76-
## Assign users and groups to roles
77-
78-
Once you've added app roles in your application, you can assign users and groups to the roles. Assignment of users and groups to roles can be done through the portal's UI, or programmatically using [Microsoft Graph](/graph/api/user-post-approleassignments). When the users assigned to the various app roles sign in to the application, their tokens will have their assigned roles in the `roles` claim.
79-
80-
To assign users and groups to roles by using the Microsoft Entra admin center:
81-
82-
1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com) as at least a [Cloud Application Administrator](../roles/permissions-reference.md#cloud-application-administrator).
83-
1. If you have access to multiple tenants, use the **Directories + subscriptions** filter :::image type="icon" source="./media/common/portal-directory-subscription-filter.png" border="false"::: in the top menu to switch to the tenant that contains the app registration to which you want to add an app role.
84-
1. Browse to **Identity** > **Applications** > **Enterprise applications**.
85-
1. Select **All applications** to view a list of all your applications. If your application doesn't appear in the list, use the filters at the top of the **All applications** list to restrict the list, or scroll down the list to locate your application.
86-
1. Select the application in which you want to assign users or security group to roles.
87-
1. Under **Manage**, select **Users and groups**.
88-
1. Select **Add user** to open the **Add Assignment** pane.
89-
1. Select the **Users and groups** selector from the **Add Assignment** pane. A list of users and security groups is displayed. You can search for a certain user or group and select multiple users and groups that appear in the list.
90-
1. Once you've selected users and groups, select the **Select** button to proceed.
91-
1. Select **Select a role** in the **Add assignment** pane. All the roles that you've defined for the application are displayed.
92-
1. Choose a role and select the **Select** button.
93-
1. Select the **Assign** button to finish the assignment of users and groups to the app.
94-
95-
Confirm that the users and groups you added appear in the **Users and groups** list.
96-
9776
## Assign app roles to applications
9877

99-
Once you've added app roles in your application, you can assign an app role to a client app by using the Microsoft Entra admin center or programmatically by using [Microsoft Graph](/graph/api/user-post-approleassignments).
78+
Once you've added app roles in your application, you can assign an app role to a client app by using the Microsoft Entra admin center or programmatically by using [Microsoft Graph](/graph/api/user-post-approleassignments). This is not to be confused with [assigning roles to users](../roles/manage-roles-portal.md).
10079

10180
When you assign app roles to an application, you create _application permissions_. Application permissions are typically used by daemon apps or back-end services that need to authenticate and make authorized API call as themselves, without the interaction of a user.
10281

@@ -108,8 +87,7 @@ To assign app roles to an application by using the Microsoft Entra admin center:
10887
1. Select the application to which you want to assign an app role.
10988
1. Select **API permissions** > **Add a permission**.
11089
1. Select the **My APIs** tab, and then select the app for which you defined app roles.
111-
1. Select **Application permissions**.
112-
1. Select the role(s) you want to assign.
90+
1. Under **Permission**, select the role(s) you want to assign.
11391
1. Select the **Add permissions** button complete addition of the role(s).
11492

11593
The newly added roles should appear in your app registration's **API permissions** pane.
@@ -147,6 +125,27 @@ Developers can use app roles to control whether a user can sign in to an app or
147125

148126
App roles are preferred by developers when they want to describe and control the parameters of authorization in their app themselves. For example, an app using groups for authorization will break in the next tenant as both the group ID and name could be different. An app using app roles remains safe. In fact, assigning groups to app roles is popular with SaaS apps for the same reasons as it allows the SaaS app to be provisioned in multiple tenants.
149127

128+
## Assign users and groups to Microsoft Entra roles
129+
130+
Once you've added app roles in your application, you can assign users and groups to [Microsoft Entra roles](../roles/permissions-reference.md). Assignment of users and groups to roles can be done through the portal's UI, or programmatically using [Microsoft Graph](/graph/api/user-post-approleassignments). When the users assigned to the various roles sign in to the application, their tokens will have their assigned roles in the `roles` claim.
131+
132+
To assign users and groups to roles by using the Microsoft Entra admin center:
133+
134+
1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com) as at least a [Cloud Application Administrator](../roles/permissions-reference.md#cloud-application-administrator).
135+
1. If you have access to multiple tenants, use the **Directories + subscriptions** filter :::image type="icon" source="./media/common/portal-directory-subscription-filter.png" border="false"::: in the top menu to switch to the tenant that contains the app registration to which you want to add an app role.
136+
1. Browse to **Identity** > **Applications** > **Enterprise applications**.
137+
1. Select **All applications** to view a list of all your applications. If your application doesn't appear in the list, use the filters at the top of the **All applications** list to restrict the list, or scroll down the list to locate your application.
138+
1. Select the application in which you want to assign users or security group to roles.
139+
1. Under **Manage**, select **Users and groups**.
140+
1. Select **Add user** to open the **Add Assignment** pane.
141+
1. Select the **Users and groups** selector from the **Add Assignment** pane. A list of users and security groups is displayed. You can search for a certain user or group and select multiple users and groups that appear in the list.
142+
1. Once you've selected users and groups, select the **Select** button to proceed.
143+
1. Select **Select a role** in the **Add assignment** pane. All the roles that you've defined for the application are displayed.
144+
1. Choose a role and select the **Select** button.
145+
1. Select the **Assign** button to finish the assignment of users and groups to the app.
146+
147+
Confirm that the users and groups you added appear in the **Users and groups** list.
148+
150149
## Next steps
151150

152151
Learn more about app roles with the following resources.

articles/active-directory/develop/quickstart-single-page-app-angular-sign-in.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: active-directory
88
ms.subservice: develop
99
ms.topic: quickstart
1010

11-
ms.date: 09/13/2023
11+
ms.date: 09/25/2023
1212
ms.author: henrymbugua
1313
ms.reviewer: j-mantu
1414
ms.custom: aaddev, "scenarios:getting-started", "languages:JavaScript", devx-track-js
@@ -19,8 +19,6 @@ ms.custom: aaddev, "scenarios:getting-started", "languages:JavaScript", devx-tra
1919

2020
This quickstart uses a sample Angular single-page app (SPA) to show you how to sign in users by using the [authorization code flow](/azure/active-directory/develop/v2-oauth2-auth-code-flow) with Proof Key for Code Exchange (PKCE) and call the Microsoft Graph API. The sample uses the [Microsoft Authentication Library for JavaScript](/javascript/api/@azure/msal-react) to handle authentication.
2121

22-
In this article you'll register a SPA in the Microsoft Entra admin center, and download a sample Angular SPA. Next, you'll run the sample application, sign in with your personal Microsoft account or a work/school account, and sign out.
23-
2422
## Prerequisites
2523

2624
* An Azure account with an active subscription. If you don't already have one, [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
@@ -56,8 +54,7 @@ To obtain the sample application, you can either clone it from GitHub or downloa
5654
```console
5755
git clone https://github.com/Azure-Samples/ms-identity-docs-code-javascript.git
5856
```
59-
60-
- [Download the .zip file](https://github.com/Azure-Samples/ms-identity-docs-code-javascript/archive/refs/heads/main.zip)
57+
- [Download the .zip file](https://github.com/Azure-Samples/ms-identity-docs-code-javascript/archive/refs/heads/main.zip). Extract it to a file path where the length of the name is fewer than 260 characters.
6158

6259
## Configure the project
6360

articles/active-directory/develop/quickstart-single-page-app-javascript-sign-in.md

Lines changed: 4 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.service: active-directory
99
ms.subservice: develop
1010
ms.topic: quickstart
1111
ms.workload: identity
12-
ms.date: 09/13/2023
12+
ms.date: 09/25/2023
1313
ms.author: henrymbugua
1414
ms.reviewer: OwenRichards1
1515
ms.custom: aaddev, "scenarios:getting-started", "languages:JavaScript", devx-track-js
@@ -20,8 +20,6 @@ ms.custom: aaddev, "scenarios:getting-started", "languages:JavaScript", devx-tra
2020

2121
This quickstart uses a sample JavaScript (JS) single-page app (SPA) to show you how to sign in users by using the [authorization code flow](/azure/active-directory/develop/v2-oauth2-auth-code-flow) with Proof Key for Code Exchange (PKCE) and call the Microsoft Graph API. The sample uses the [Microsoft Authentication Library for JavaScript](/javascript/api/@azure/msal-react) to handle authentication.
2222

23-
In this article you'll register a SPA in the Microsoft Entra admin center, and download a sample JS SPA. Next, you'll run the sample application, sign in with your personal Microsoft account or a work or school account, and sign out.
24-
2523
## Prerequisites
2624

2725
* An Azure account with an active subscription. If you don't already have one, [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
@@ -57,85 +55,14 @@ To obtain the sample application, you can either clone it from GitHub or downloa
5755
```console
5856
git clone https://github.com/Azure-Samples/ms-identity-javascript-tutorial
5957
```
60-
61-
- [Download the .zip file](https://github.com/Azure-Samples/ms-identity-javascript-tutorial/archive/refs/heads/main.zip).
58+
- [Download the .zip file](https://github.com/Azure-Samples/ms-identity-javascript-tutorial/archive/refs/heads/main.zip). Extract it to a file path where the length of the name is fewer than 260 characters.
6259

6360
## Configure the project
6461

6562
1. In your IDE, open the project folder, *ms-identity-javascript-tutorial/angular-spa*, containing the sample.
6663
1. Open *1-Authentication/1-sign-in/App/authConfig.js* and replace the file contents with the following snippet:
6764

68-
```javascript
69-
/**
70-
* Configuration object to be passed to MSAL instance on creation.
71-
* For a full list of MSAL.js configuration parameters, visit:
72-
* https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/configuration.md
73-
*/
74-
75-
const msalConfig = {
76-
auth: {
77-
clientId: 'Enter_the_Application_Id_Here', // This is the ONLY mandatory field that you need to supply.
78-
authority: 'https://login.microsoftonline.com/Enter_the_Tenant_Info_Here', // Defaults to "https://login.microsoftonline.com/common"
79-
redirectUri: '/', // You must register this URI on Azure Portal/App Registration. Defaults to window.location.href e.g. http://localhost:3000/
80-
navigateToLoginRequestUrl: true, // If "true", will navigate back to the original request location before processing the auth code response.
81-
},
82-
cache: {
83-
cacheLocation: 'sessionStorage', // Configures cache location. "sessionStorage" is more secure, but "localStorage" gives you SSO.
84-
storeAuthStateInCookie: false, // set this to true if you have to support IE
85-
},
86-
system: {
87-
loggerOptions: {
88-
loggerCallback: (level, message, containsPii) => {
89-
if (containsPii) {
90-
return;
91-
}
92-
switch (level) {
93-
case msal.LogLevel.Error:
94-
console.error(message);
95-
return;
96-
case msal.LogLevel.Info:
97-
console.info(message);
98-
return;
99-
case msal.LogLevel.Verbose:
100-
console.debug(message);
101-
return;
102-
case msal.LogLevel.Warning:
103-
console.warn(message);
104-
return;
105-
}
106-
},
107-
},
108-
},
109-
};
110-
111-
/**
112-
* Scopes you add here will be prompted for user consent during sign-in.
113-
* By default, MSAL.js will add OIDC scopes (openid, profile, email) to any login request.
114-
* For more information about OIDC scopes, visit:
115-
* https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-permissions-and-consent#openid-connect-scopes
116-
*/
117-
const loginRequest = {
118-
scopes: ["openid", "profile"],
119-
};
120-
121-
/**
122-
* An optional silentRequest object can be used to achieve silent SSO
123-
* between applications by providing a "login_hint" property.
124-
*/
125-
126-
// const silentRequest = {
127-
// scopes: ["openid", "profile"],
128-
// loginHint: "[email protected]"
129-
// };
130-
131-
// exporting config object for jest
132-
if (typeof exports !== 'undefined') {
133-
module.exports = {
134-
msalConfig: msalConfig,
135-
loginRequest: loginRequest,
136-
};
137-
}
138-
```
65+
:::code language="csharp" source="~/ms-identity-docs-code-javascript/js-spa/App/authConfig.js":::
13966

14067
* `TenantId` - The identifier of the tenant where the application is registered. Replace the text in quotes with the **Directory (tenant) ID** that was recorded earlier from the overview page of the registered application.
14168
* `ClientId` - The identifier of the application, also referred to as the client. Replace the text in quotes with the **Directory (tenant) ID** value that was recorded earlier from the overview page of the registered application.
@@ -151,7 +78,7 @@ Run the project with a web server by using Node.js:
15178
npm install
15279
npm start
15380
```
154-
1. Copy the https URL that appears in the terminal, for example, `https://localhost:3000`, and paste it into a browser. We recommend using a private or incognito browser session.
81+
1. Copy the `https` URL that appears in the terminal, for example, `https://localhost:3000`, and paste it into a browser. We recommend using a private or incognito browser session.
15582
1. Follow the steps and enter the necessary details to sign in with your Microsoft account. You'll be requested an email address so a one time passcode can be sent to you. Enter the code when prompted.
15683
1. The application will request permission to maintain access to data you have given it access to, and to sign you in and read your profile. Select **Accept**.
15784
1. The following screenshot appears, indicating that you have signed in to the application and have accessed your profile details from the Microsoft Graph API.

articles/active-directory/develop/quickstart-single-page-app-react-sign-in.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.service: active-directory
99
ms.subservice: develop
1010
ms.topic: quickstart
1111
ms.workload: identity
12-
ms.date: 09/13/2023
12+
ms.date: 09/25/2023
1313
ms.author: henrymbugua
1414
ms.reviewer: j-mantu
1515
ms.custom: aaddev, "scenarios:getting-started", "languages:JavaScript", devx-track-js
@@ -20,8 +20,6 @@ ms.custom: aaddev, "scenarios:getting-started", "languages:JavaScript", devx-tra
2020

2121
This quickstart uses a sample React single-page app (SPA) to show you how to sign in users by using the [authorization code flow](/azure/active-directory/develop/v2-oauth2-auth-code-flow) with Proof Key for Code Exchange (PKCE). The sample uses the [Microsoft Authentication Library for JavaScript](/javascript/api/@azure/msal-react) to handle authentication.
2222

23-
In this article you'll register a SPA in the Microsoft Entra admin center, and download a sample React SPA. Next, you'll run the sample application, sign in with your personal Microsoft account or a work or school account, and sign out.
24-
2523
## Prerequisites
2624

2725
* An Azure account with an active subscription. If you don't already have one, [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
@@ -36,7 +34,6 @@ In this article you'll register a SPA in the Microsoft Entra admin center, and d
3634
1. Select **New registration**.
3735
1. When the **Register an application** page appears, enter a name for your application, such as *identity-client-app*.
3836
1. Under **Supported account types**, select **Accounts in any organizational directory and personal Microsoft accounts**.
39-
1. The application's overview pane is displayed when registration is complete. Record the **Directory (tenant) ID** and the **Application (client) ID** to be used in your application source code.
4037
1. Select **Register**.
4138
1. The application's Overview pane displays upon successful registration. Record the **Application (client) ID** and **Directory (tenant) ID** to be used in your application source code.
4239

@@ -58,9 +55,7 @@ To obtain the sample application, you can either clone it from GitHub or downloa
5855
```console
5956
git clone https://github.com/Azure-Samples/ms-identity-docs-code-javascript.git
6057
```
61-
- [Download the .zip file](https://github.com/Azure-Samples/ms-identity-docs-code-javascript/tree/main)
62-
63-
If you choose to download the `.zip` file, extract the sample app file to a folder where the total length of the path is 260 or fewer characters.
58+
- [Download the .zip file](https://github.com/Azure-Samples/ms-identity-docs-code-javascript/tree/main). Extract it to a file path where the length of the name is fewer than 260 characters.
6459

6560
## Configure the project
6661

articles/active-directory/develop/quickstart-web-app-aspnet-core-sign-in.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ In this article you register a web application in the Microsoft Entra admin cent
5252
## Clone or download the sample application
5353

5454
To obtain the sample application, you can either clone it from GitHub or download it as a *.zip* file.
55-
- [Download the .zip file](https://github.com/Azure-Samples/ms-identity-docs-code-dotnet/archive/refs/heads/main.zip). Extract it to a file path where the length of the name is fewer than 260 characters.
5655
- To clone the sample, open a command prompt and navigate to where you wish to create the project, and enter the following command:
5756

5857
```console
5958
git clone https://github.com/Azure-Samples/ms-identity-docs-code-dotnet.git
6059
```
60+
- [Download the .zip file](https://github.com/Azure-Samples/ms-identity-docs-code-dotnet/archive/refs/heads/main.zip). Extract it to a file path where the length of the name is fewer than 260 characters.
6161

6262
## Create and upload a self-signed certificate
6363

articles/active-directory/develop/single-page-app-tutorial-02-prepare-spa.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Identity related **npm** packages must be installed in the project to enable use
7676
1. Ensure that the correct directory is selected (*reactspalocal*) then enter the following into the terminal to install the relevant `msal` and `bootstrap` packages.
7777
7878
```powershell
79-
npm install @azure/msal-browser @azure/msal-react
79+
npm install @azure/msal-browser @azure/msal-react @azure/msal-common
8080
npm install react-bootstrap bootstrap
8181
```
8282
---

0 commit comments

Comments
 (0)