Skip to content

Commit fca9cdd

Browse files
author
Tiago Brenck
authored
Merge pull request #201 from Azure-Samples/tibre/readmeTypoFixes
Fixed README s typos and broken links
2 parents ebbc4d5 + 779cfdf commit fca9cdd

File tree

6 files changed

+58
-34
lines changed

6 files changed

+58
-34
lines changed

Diff for: .github/ISSUE_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ IF SUFFICIENT INFORMATION IS NOT PROVIDED VIA THE FOLLOWING TEMPLATE THE ISSUE M
1616

1717
Please add an 'x' for the scenario(s) where you found an issue
1818

19-
1. [ ] Web app that signs in users
19+
1. Web app that signs in users
2020
1. [ ] with a work and school account in your organization: [1-WebApp-OIDC/1-1-MyOrg](../blob/master/1-WebApp-OIDC/1-1-MyOrg)
2121
1. [ ] with any work and school account: [/1-WebApp-OIDC/1-2-AnyOrg](../blob/master/1-WebApp-OIDC/1-2-AnyOrg)
2222
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
2727
1. [ ] With specific token caches: [2-WebApp-graph-user/2-2-TokenCache](../blob/master/2-WebApp-graph-user/2-2-TokenCache)
2828
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)
2929
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)
3131
1. Web app restricting users
3232
1. [ ] by Roles: [5-WebApp-AuthZ/5-1-Roles](../blob/master/5-WebApp-AuthZ/5-1-Roles)
3333
1. [ ] by Groups: [5-WebApp-AuthZ/5-2-Groups](../blob/master/5-WebApp-AuthZ/5-2-Groups)

Diff for: 1-WebApp-OIDC/1-2-AnyOrg/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This sample shows how to build a .NET Core 2.2 MVC Web app that uses OpenID Conn
2121
![Sign in with Azure AD](ReadmeFiles/sign-in.png)
2222

2323
> 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)
2525
2626
## How to run this sample
2727

@@ -42,7 +42,7 @@ There is one project in this sample. To register it, you can:
4242
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
4343
```
4444
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
4646
4747
```PowerShell
4848
.\AppCreationScripts\Configure.ps1
@@ -69,7 +69,7 @@ As a first step you'll need to:
6969
1. When the **Register an application page** appears, enter your application's registration information:
7070
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `WebApp`.
7171
- 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.
7373
1. Select **Register** to create the application.
7474
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.
7575
1. In the list of pages for the app, select **Authentication**..

Diff for: 2-WebApp-graph-user/2-1-Call-MSGraph/AppCreationScripts/Cleanup.ps1

+15-8
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ param(
55
[string] $tenantId
66
)
77

8-
if ((Get-Module -ListAvailable -Name "AzureAD") -eq $null) {
8+
if ($null -eq (Get-Module -ListAvailable -Name "AzureAD")) {
99
Install-Module "AzureAD" -Scope CurrentUser
1010
}
1111
Import-Module AzureAD
12-
$ErrorActionPreference = 'Stop'
12+
$ErrorActionPreference = "Stop"
1313

1414
Function Cleanup
1515
{
@@ -44,20 +44,27 @@ This function removes the Azure AD applications for the sample. These applicatio
4444
$tenantId = $creds.Tenant.Id
4545
}
4646
$tenant = Get-AzureADTenantDetail
47-
$tenantName = ($tenant.VerifiedDomains | Where { $_._Default -eq $True }).Name
47+
$tenantName = ($tenant.VerifiedDomains | Where-Object { $_._Default -eq $True }).Name
4848

4949
# Removes the applications
5050
Write-Host "Cleaning-up applications from tenant '$tenantName'"
5151

5252
Write-Host "Removing 'webApp' (WebApp-OpenIDConnect-DotNet-code-v2) if needed"
53-
$app=Get-AzureADApplication -Filter "DisplayName eq 'WebApp-OpenIDConnect-DotNet-code-v2'"
53+
Get-AzureADApplication -Filter "DisplayName eq 'WebApp-OpenIDConnect-DotNet-code-v2'" | ForEach-Object {Remove-AzureADApplication -ObjectId $_.ObjectId }
54+
$apps = Get-AzureADApplication -Filter "DisplayName eq 'WebApp-OpenIDConnect-DotNet-code-v2'"
55+
if ($apps)
56+
{
57+
Remove-AzureADApplication -ObjectId $apps.ObjectId
58+
}
5459

55-
if ($app)
60+
foreach ($app in $apps)
5661
{
5762
Remove-AzureADApplication -ObjectId $app.ObjectId
58-
Write-Host "Removed."
63+
Write-Host "Removed WebApp-OpenIDConnect-DotNet-code-v2.."
5964
}
60-
65+
# also remove service principals of this app
66+
Get-AzureADServicePrincipal -filter "DisplayName eq 'WebApp-OpenIDConnect-DotNet-code-v2'" | ForEach-Object {Remove-AzureADServicePrincipal -ObjectId $_.Id -Confirm:$false}
67+
6168
}
6269

63-
Cleanup -Credential $Credential -tenantId $TenantId
70+
Cleanup -Credential $Credential -tenantId $TenantId

Diff for: 2-WebApp-graph-user/2-1-Call-MSGraph/AppCreationScripts/Configure.ps1

+13-6
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Function AddResourcePermission($requiredAccess, `
6565
}
6666

6767
#
68-
# Exemple: GetRequiredPermissions "Microsoft Graph" "Graph.Read|User.Read"
68+
# Example: GetRequiredPermissions "Microsoft Graph" "Graph.Read|User.Read"
6969
# See also: http://stackoverflow.com/questions/42164581/how-to-configure-a-new-azure-ad-application-through-powershell
7070
Function GetRequiredPermissions([string] $applicationDisplayName, [string] $requiredDelegatedPermissions, [string]$requiredApplicationPermissions, $servicePrincipal)
7171
{
@@ -137,13 +137,16 @@ Function UpdateTextFile([string] $configFilePath, [System.Collections.HashTable]
137137
Set-Content -Value "<html><body><table>" -Path createdApps.html
138138
Add-Content -Value "<thead><tr><th>Application</th><th>AppId</th><th>Url in the Azure portal</th></tr></thead><tbody>" -Path createdApps.html
139139

140+
$ErrorActionPreference = "Stop"
141+
140142
Function ConfigureApplications
141143
{
142144
<#.Description
143145
This function creates the Azure AD applications for the sample in the provided Azure AD tenant and updates the
144146
configuration files in the client and service project of the visual studio solution (App.Config and Web.Config)
145147
so that they are consistent with the Applications parameters
146148
#>
149+
$commonendpoint = "common"
147150

148151
# $tenantId is the Active Directory Tenant. This is a GUID which represents the "Directory ID" of the AzureAD tenant
149152
# into which you want to create the apps. Look it up in the Azure portal in the "Properties" of the Azure AD.
@@ -174,7 +177,7 @@ Function ConfigureApplications
174177
$tenant = Get-AzureADTenantDetail
175178
$tenantName = ($tenant.VerifiedDomains | Where { $_._Default -eq $True }).Name
176179

177-
# Get the user running the script
180+
# Get the user running the script to add the user as the app owner
178181
$user = Get-AzureADUser -ObjectId $creds.Account.Id
179182

180183
# Create the webApp AAD application
@@ -184,6 +187,7 @@ Function ConfigureApplications
184187
$fromDate = [DateTime]::Now;
185188
$key = CreateAppKey -fromDate $fromDate -durationInYears 2 -pw $pw
186189
$webAppAppKey = $pw
190+
# create the application
187191
$webAppAadApplication = New-AzureADApplication -DisplayName "WebApp-OpenIDConnect-DotNet-code-v2" `
188192
-HomePage "https://localhost:44321/" `
189193
-LogoutUrl "https://localhost:44321/signout-oidc" `
@@ -194,17 +198,19 @@ Function ConfigureApplications
194198
-Oauth2AllowImplicitFlow $true `
195199
-PublicClient $False
196200

201+
# create the service principal of the newly created application
197202
$currentAppId = $webAppAadApplication.AppId
198203
$webAppServicePrincipal = New-AzureADServicePrincipal -AppId $currentAppId -Tags {WindowsAzureActiveDirectoryIntegratedApp}
199204

200205
# add the user running the script as an app owner if needed
201206
$owner = Get-AzureADApplicationOwner -ObjectId $webAppAadApplication.ObjectId
202207
if ($owner -eq $null)
203208
{
204-
Add-AzureADApplicationOwner -ObjectId $webAppAadApplication.ObjectId -RefObjectId $user.ObjectId
205-
Write-Host "'$($user.UserPrincipalName)' added as an application owner to app '$($webAppServicePrincipal.DisplayName)'"
209+
Add-AzureADApplicationOwner -ObjectId $webAppAadApplication.ObjectId -RefObjectId $user.ObjectId
210+
Write-Host "'$($user.UserPrincipalName)' added as an application owner to app '$($webAppServicePrincipal.DisplayName)'"
206211
}
207212

213+
208214
Write-Host "Done creating the webApp application (WebApp-OpenIDConnect-DotNet-code-v2)"
209215

210216
# URL of the AAD application in the Azure portal
@@ -230,14 +236,15 @@ Function ConfigureApplications
230236
Write-Host "Updating the sample code ($configFile)"
231237
$dictionary = @{ "ClientId" = $webAppAadApplication.AppId;"TenantId" = $tenantId;"Domain" = $tenantName;"ClientSecret" = $webAppAppKey };
232238
UpdateTextFile -configFilePath $configFile -dictionary $dictionary
233-
239+
234240
Add-Content -Value "</tbody></table></body></html>" -Path createdApps.html
235241
}
236242

237243
# Pre-requisites
238244
if ((Get-Module -ListAvailable -Name "AzureAD") -eq $null) {
239245
Install-Module "AzureAD" -Scope CurrentUser
240-
}
246+
}
247+
241248
Import-Module AzureAD
242249

243250
# Run interactively (will ask you for the tenant ID)

Diff for: 2-WebApp-graph-user/2-1-Call-MSGraph/README.md

+23-13
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ endpoint: Microsoft identity platform
1414

1515
## Scenario
1616

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.
1818

1919
![Sign in with the Microsoft identity platform](ReadmeFiles/sign-in.png)
2020

@@ -28,17 +28,22 @@ To run this sample:
2828
2929
### Step 1: Register the sample with your Azure AD tenant
3030

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)
3232

3333
Then follow the following extra set of steps:
3434

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.
4247

4348
### Step 2: Download/Clone/Go to the folder containing the sample code and build the application
4449

@@ -56,11 +61,16 @@ Go to the `"2-WebApp-graph-user\2-1-Call-MSGraph"` folder
5661
cd "2-WebApp-graph-user\2-1-Call-MSGraph"
5762
```
5863

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".
6068
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.
6474

6575
- 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
6676

Diff for: 3-WebApp-multi-APIs/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ To run this sample:
2424

2525
> Pre-requisites:
2626
>
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).
2828
>
2929
> This chapter shows the incremental changes required to call two Microsoft APIs other than Microsoft Graph (Azure Resource Management and Azure Storage).
3030
3131
### Step 1: Register the sample with your Azure AD tenant
3232

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)
3434

3535
Then, the follow the following extra set of steps:
3636

0 commit comments

Comments
 (0)