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: .github/ISSUE_TEMPLATE.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ IF SUFFICIENT INFORMATION IS NOT PROVIDED VIA THE FOLLOWING TEMPLATE THE ISSUE M
16
16
17
17
Please add an 'x' for the scenario(s) where you found an issue
18
18
19
-
1.[ ]Web app that signs in users
19
+
1. Web app that signs in users
20
20
1.[ ] with a work and school account in your organization: [1-WebApp-OIDC/1-1-MyOrg](../blob/master/1-WebApp-OIDC/1-1-MyOrg)
21
21
1.[ ] with any work and school account: [/1-WebApp-OIDC/1-2-AnyOrg](../blob/master/1-WebApp-OIDC/1-2-AnyOrg)
22
22
1.[ ] with any work or school account or Microsoft personal account: [1-WebApp-OIDC/1-3-AnyOrgOrPersonal](../blob/master/1-WebApp-OIDC/1-3-AnyOrgOrPersonal)
@@ -27,7 +27,7 @@ Please add an 'x' for the scenario(s) where you found an issue
27
27
1.[ ] With specific token caches: [2-WebApp-graph-user/2-2-TokenCache](../blob/master/2-WebApp-graph-user/2-2-TokenCache)
28
28
1.[ ] Calling Microsoft Graph in national clouds: [2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph](../blob/master/2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph)
29
29
1.[ ] Web app calling several APIs [3-WebApp-multi-APIs](../blob/master/3-WebApp-multi-APIs)
30
-
1.[ ] Web app calling your own Web API
30
+
1.[ ] Web app calling your own Web API[4-WebApp-your-API](../blob/master/4-WebApp-your-API)
31
31
1. Web app restricting users
32
32
1.[ ] by Roles: [5-WebApp-AuthZ/5-1-Roles](../blob/master/5-WebApp-AuthZ/5-1-Roles)
33
33
1.[ ] by Groups: [5-WebApp-AuthZ/5-2-Groups](../blob/master/5-WebApp-AuthZ/5-2-Groups)
Copy file name to clipboardExpand all lines: 1-WebApp-OIDC/1-2-AnyOrg/README.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ This sample shows how to build a .NET Core 2.2 MVC Web app that uses OpenID Conn
21
21

22
22
23
23
> This is the second chapter of the first phase of this ASP.NET Core Web App tutorial. Once you understand how to sign-in users in an ASP.NET Core Web App with Open Id Connect, can learn how to enable your [Web App to call a Web API on behalf of the signed-in user](../../2-WebApp-graph-user) in a later chapter.
24
-
> You can also sign-in users in your own Azure Active Directory organizations, and even with Microsoft personal accounts or social identities. For more details the parent directory's [Readme.md](../Readme.md)
24
+
> You can also sign-in users in your own Azure Active Directory organizations, and even with Microsoft personal accounts or social identities. For more details the parent directory's [Readme.md](../README.md)
25
25
26
26
## How to run this sample
27
27
@@ -42,7 +42,7 @@ There is one project in this sample. To register it, you can:
42
42
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
43
43
```
44
44
45
-
3. Run the script to create your Azure AD application and configure the code of the sample application accordinly
45
+
3. Run the script to create your Azure AD application and configure the code of the sample application accordingly
46
46
47
47
```PowerShell
48
48
.\AppCreationScripts\Configure.ps1
@@ -69,7 +69,7 @@ As a first step you'll need to:
69
69
1. When the **Register an application page** appears, enter your application's registration information:
70
70
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `WebApp`.
71
71
- In the **Supported account types** section, select **Accounts in any organizational directory**.
72
-
> Note that there are more than one redirect URIs. You'll need to add them from the **Authentication** tab later after the app has been created succesfully.
72
+
> Note that there are more than one redirect URIs. You'll need to add them from the **Authentication** tab later after the app has been created successfully.
73
73
1. Select **Register** to create the application.
74
74
1. On the app **Overview** page, find the **Application (client) ID** value and record it for later. You'll need it to configure the Visual Studio configuration file for this project.
75
75
1. In the list of pages for the app, select **Authentication**..
Copy file name to clipboardExpand all lines: 2-WebApp-graph-user/2-1-Call-MSGraph/README.md
+23-13
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ endpoint: Microsoft identity platform
14
14
15
15
## Scenario
16
16
17
-
Starting from a .NET Core 2.2 MVC Web app that uses OpenID Connect to sign in users, this phase of the tutorial shows how to call Microsoft Graph /me endpoint on behalf of the signed-in user. It leverages the ASP.NET Core OpenID Connect middleware and Microsoft Authentication Library for .NET (MSAL.NET). Their complexities where encapsultated into the `Microsoft.Identity.Web` reusable library project part of this tutorial. Once again the notion of ASP.NET services injected by dependency injection is heavily used.
17
+
Starting from a .NET Core 2.2 MVC Web app that uses OpenID Connect to sign in users, this phase of the tutorial shows how to call Microsoft Graph /me endpoint on behalf of the signed-in user. It leverages the ASP.NET Core OpenID Connect middleware and Microsoft Authentication Library for .NET (MSAL.NET). Their complexities where encapsulated into the `Microsoft.Identity.Web` reusable library project part of this tutorial. Once again the notion of ASP.NET services injected by dependency injection is heavily used.
18
18
19
19

20
20
@@ -28,17 +28,22 @@ To run this sample:
28
28
29
29
### Step 1: Register the sample with your Azure AD tenant
30
30
31
-
You first need to [register](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/aspnetcore2-2#step-1-register-the-sample-with-your-azure-ad-tenant) your app as described in [the first tutorial](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/aspnetcore2-2)
31
+
You first need to [register](../../1-WebApp-OIDC/1-1-MyOrg#step-1-register-the-sample-with-your-azure-ad-tenant) your app as described in [the first tutorial](../../1-WebApp-OIDC/1-1-MyOrg)
32
32
33
33
Then follow the following extra set of steps:
34
34
35
-
1. From the **Certificates & secrets** page, for your app registration, in the **Client secrets** section, choose **New client secret**:
36
-
37
-
- Type a key description (of instance `app secret`),
38
-
- Select a key duration of either **In 1 year**, **In 2 years**, or **Never Expires**.
39
-
- When you press the **Add** button, the key value will be displayed, copy, and save the value in a safe location.
40
-
- You'll need this key later to configure the project in Visual Studio. This key value will not be displayed again, nor retrievable by any other means.
41
-
1. In the list of pages for the app, select **API permissions**, and notice that a delegated permission is set by default to Microsoft Graph for the scope **User.Read**
35
+
1. In the app's registration screen, click on the **Certificates & secrets** blade in the left to open the page where we can generate secrets and upload certificates.
36
+
1. In the **Client secrets** section, click on **New client secret**:
37
+
- Type a key description (for instance `app secret`),
38
+
- Select one of the available key durations (**In 1 year**, **In 2 years**, or **Never Expires**) as per your security concerns.
39
+
- The generated key value will be displayed when you click the **Add** button. Copy the generated value for use in the steps later.
40
+
- You'll need this key later in your code's configuration files. This key value will not be displayed again, and is not retrievable by any other means, so make sure to note it from the Azure portal before navigating to any other screen or blade.
41
+
1. In the app's registration screen, click on the **API permissions** blade in the left to open the page where we add access to the Apis that your application needs.
42
+
- Click the **Add permissions** button and then,
43
+
- Ensure that the **Microsoft APIs** tab is selected.
44
+
- In the *Commonly used Microsoft APIs* section, click on **Microsoft Graph**
45
+
- In the **Delegated permissions** section, select the **User.Read** in the list. Use the search box if necessary.
46
+
- Click on the **Add permissions** button in the bottom.
42
47
43
48
### Step 2: Download/Clone/Go to the folder containing the sample code and build the application
44
49
@@ -56,11 +61,16 @@ Go to the `"2-WebApp-graph-user\2-1-Call-MSGraph"` folder
56
61
cd"2-WebApp-graph-user\2-1-Call-MSGraph"
57
62
```
58
63
59
-
In the appsettings.json file, replace, if you have not already:
64
+
#### Configure the webApp app (WebApp-OpenIDConnect-DotNet-code-v2) to use your app registration
65
+
66
+
Open the project in your IDE (like Visual Studio) to configure the code.
67
+
>In the steps below, "ClientID" is the same as "Application ID" or "AppId".
60
68
61
-
- the `ClientID` value with the *Application ID* from the application you registered in Application Registration portal,
62
-
- the `TenantId` by `common`, as here you chose to sign-in users with their work or school or personal account. In case you want to sign-in different audiences, refer back to the first phase of the tutorial
63
-
- and the `ClientSecret` by the client secret you generated in Step 1.
69
+
1. Open the `appsettings.json` file
70
+
1. Find the app key `ClientId` and replace the existing value with the application ID (clientId) of the `WebApp-OpenIDConnect-DotNet-code-v2` application copied from the Azure portal.
71
+
1. Find the app key `TenantId` and replace by `common`, as here you chose to sign-in users with their work or school or personal account. In case you want to sign-in different audiences, refer back to the first phase of the tutorial.
72
+
1. Find the app key `Domain` and replace the existing value with your Azure AD tenant name.
73
+
1. Find the app key `ClientSecret` and replace the existing value with the key you saved during the creation of the `WebApp-OpenIDConnect-DotNet-code-v2` app, in the Azure portal.
64
74
65
75
- In case you want to deploy your app in Sovereign or national clouds, ensure the `GraphApiUrl` option matches the one you want. By default this is Microsoft Graph in the Azure public cloud
Copy file name to clipboardExpand all lines: 3-WebApp-multi-APIs/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -24,13 +24,13 @@ To run this sample:
24
24
25
25
> Pre-requisites:
26
26
>
27
-
> This is the third phase of the tutorial. It's recommended that you have gone through the previous phases of the tutorial, in particular how the [WebApp signs-in users with Microsoft Identity (OIDC) / with work and school or personal accounts](../../1-WebApp-OIDC/1-3-AnyOrgOrPersonal) and [Web app calls the Microsoft Graph API on behalf of a user signing-in](../../2-WebApp-graph-user/2-1-Call-MSGraph).
27
+
> This is the third phase of the tutorial. It's recommended that you have gone through the previous phases of the tutorial, in particular how the [WebApp signs-in users with Microsoft Identity (OIDC) / with work and school or personal accounts](../1-WebApp-OIDC/1-3-AnyOrgOrPersonal) and [Web app calls the Microsoft Graph API on behalf of a user signing-in](../2-WebApp-graph-user/2-1-Call-MSGraph).
28
28
>
29
29
> This chapter shows the incremental changes required to call two Microsoft APIs other than Microsoft Graph (Azure Resource Management and Azure Storage).
30
30
31
31
### Step 1: Register the sample with your Azure AD tenant
32
32
33
-
You first need to [register](../../1-3-AnyOrgOrPersonal/README.md#step-1-register-the-sample-with-your-azure-ad-tenant/README.md) your app as described in [the first phase of the tutorial](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/1-WebApp-OIDC)
33
+
You first need to [register](../1-WebApp-OIDC/1-3-AnyOrgOrPersonal/README.md#step-1-register-the-sample-with-your-azure-ad-tenant/README.md) your app as described in [the first phase of the tutorial](../1-WebApp-OIDC)
34
34
35
35
Then, the follow the following extra set of steps:
0 commit comments