Skip to content

Commit 5c27fe1

Browse files
Minor fixes
1 parent b5f0f00 commit 5c27fe1

6 files changed

Lines changed: 21 additions & 18 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,4 @@ dist
105105

106106
# NPM lock file
107107
package-lock.json
108+
/.vs

1-Authentication/1-sign-in/AppCreationScripts/Cleanup.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ Function Cleanup
5959
# Removes the applications
6060
Write-Host "Cleaning-up applications from tenant '$tenantName'"
6161

62-
Write-Host "Removing 'webApp' (WebApp) if needed"
63-
Get-AzureADApplication -Filter "DisplayName eq 'WebApp'" | ForEach-Object {Remove-AzureADApplication -ObjectId $_.ObjectId }
64-
$apps = Get-AzureADApplication -Filter "DisplayName eq 'WebApp'"
62+
Write-Host "Removing 'webApp' (ms-identity-nodejs-webapp) if needed"
63+
Get-AzureADApplication -Filter "DisplayName eq 'ms-identity-nodejs-webapp'" | ForEach-Object {Remove-AzureADApplication -ObjectId $_.ObjectId }
64+
$apps = Get-AzureADApplication -Filter "DisplayName eq 'ms-identity-nodejs-webapp'"
6565
if ($apps)
6666
{
6767
Remove-AzureADApplication -ObjectId $apps.ObjectId
@@ -73,7 +73,7 @@ Function Cleanup
7373
Write-Host "Removed WebApp.."
7474
}
7575
# also remove service principals of this app
76-
Get-AzureADServicePrincipal -filter "DisplayName eq 'WebApp'" | ForEach-Object {Remove-AzureADServicePrincipal -ObjectId $_.Id -Confirm:$false}
76+
Get-AzureADServicePrincipal -filter "DisplayName eq 'ms-identity-nodejs-webapp'" | ForEach-Object {Remove-AzureADServicePrincipal -ObjectId $_.Id -Confirm:$false}
7777

7878
}
7979

1-Authentication/1-sign-in/AppCreationScripts/Configure.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,16 @@ Function ConfigureApplications
137137
$user = Get-AzureADUser -ObjectId $creds.Account.Id
138138

139139
# Create the webApp AAD application
140-
Write-Host "Creating the AAD application (WebApp)"
140+
Write-Host "Creating the AAD application (ms-identity-nodejs-webapp)"
141141
# Get a 2 years application key for the webApp Application
142142
$pw = ComputePassword
143143
$fromDate = [DateTime]::Now;
144144
$key = CreateAppKey -fromDate $fromDate -durationInYears 2 -pw $pw
145145
$webAppAppKey = $pw
146146
# create the application
147-
$webAppAadApplication = New-AzureADApplication -DisplayName "WebApp" `
147+
$webAppAadApplication = New-AzureADApplication -DisplayName "ms-identity-nodejs-webapp" `
148148
-HomePage "https://localhost:4000" `
149-
-ReplyUrls "https://localhost:4000/redirect" `
149+
-ReplyUrls "http://localhost:4000/redirect" `
150150
-IdentifierUris "https://$tenantName/WebApp" `
151151
-PasswordCredentials $key `
152152
-PublicClient $False
@@ -164,18 +164,18 @@ Function ConfigureApplications
164164
}
165165

166166

167-
Write-Host "Done creating the webApp application (WebApp)"
167+
Write-Host "Done creating the webApp application (ms-identity-nodejs-webapp)"
168168

169169
# URL of the AAD application in the Azure portal
170170
# Future? $webAppPortalUrl = "https://portal.azure.com/#@"+$tenantName+"/blade/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/Overview/appId/"+$webAppAadApplication.AppId+"/objectId/"+$webAppAadApplication.ObjectId+"/isMSAApp/"
171171
$webAppPortalUrl = "https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/CallAnAPI/appId/"+$webAppAadApplication.AppId+"/objectId/"+$webAppAadApplication.ObjectId+"/isMSAApp/"
172172
Add-Content -Value "<tr><td>webApp</td><td>$currentAppId</td><td><a href='$webAppPortalUrl'>WebApp</a></td></tr>" -Path createdApps.html
173173

174174

175-
# Update config file for 'webApp'
175+
# Update config file for 'ms-identity-nodejs-webapp'
176176
$configFile = $pwd.Path + "\..\auth.json"
177177
Write-Host "Updating the sample code ($configFile)"
178-
$dictionary = @{ "ClientId" = $webAppAadApplication.AppId;"TenantId" = $tenantId;"ClientSecret" = $webAppAppKey };
178+
$dictionary = @{ "clientId" = $webAppAadApplication.AppId;"tenantId" = $tenantId;"clientSecret" = $webAppAppKey };
179179
UpdateTextFile -configFilePath $configFile -dictionary $dictionary
180180

181181
Add-Content -Value "</tbody></table></body></html>" -Path createdApps.html

1-Authentication/1-sign-in/AppCreationScripts/sample.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@
1313
"Kind": "WebApp",
1414
"Audience": "AzureADMyOrg",
1515
"HomePage": "https://localhost:4000",
16-
"ReplyUrls": "https://localhost:4000/redirect",
16+
"ReplyUrls": "http://localhost:4000/redirect",
1717
"PasswordCredentials": "Auto"
1818
}
1919
],
2020
"CodeConfiguration": [
2121
{
22-
"App": "webApp",
22+
"App": "ms-identity-nodejs-webapp",
2323
"SettingKind": "JSON",
2424
"SettingFile": "\\..\\auth.json",
2525
"Mappings": [
2626
{
27-
"key": "ClientId",
27+
"key": "clientId",
2828
"value": ".AppId"
2929
},
3030
{
31-
"key": "TenantId",
31+
"key": "tenantId",
3232
"value": "$tenantId"
3333
},
3434
{
35-
"key": "ClientSecret",
35+
"key": "clientSecret",
3636
"value": ".AppKey"
3737
}
3838
]

1-Authentication/1-sign-in/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ name: A Node.js & Express Web App authenticating users against Azure AD with MSA
1010
urlFragment: ms-identity-javascript-nodejs-tutorial
1111
description: "This sample demonstrates a Node.js & Express Web App authenticating users against Azure AD with MSAL Node"
1212
---
13+
1314
# A Node.js & Express Web App authenticating users against Azure AD with MSAL Node
1415

1516
1. [Overview](#overview)
@@ -27,7 +28,7 @@ description: "This sample demonstrates a Node.js & Express Web App authenticatin
2728

2829
## Overview
2930

30-
This sample demonstrates a Node.js & Express web application that authenticates users against Azure AD, with the help of [Microsoft Authentication Library for Node.js]() (MSAL Node). In doing so, it also illustrates various authentication concepts, such as [OIDC scopes](), [ID Tokens](), [ID Token validation](), [National Clouds]() and more.
31+
This sample demonstrates a Node.js & Express web application that authenticates users against Azure AD, with the help of [Microsoft Authentication Library for Node.js](https://aka.ms/msalnode) (MSAL Node). In doing so, it also illustrates various authentication concepts, such as [OpenID scopes](https://docs.microsoft.com/azure/active-directory/develop/v2-permissions-and-consent#openid-connect-scopes), [ID Tokens](https://docs.microsoft.com/azure/active-directory/develop/id-tokens), [ID Token validation]() and more.
3132

3233
## Scenario
3334

@@ -73,6 +74,7 @@ or download and extract the repository .zip file.
7374
Locate the root of the sample folder. Then:
7475

7576
```console
77+
cd 1-Authentication\1-sign-in
7678
npm install
7779
```
7880

@@ -123,7 +125,7 @@ As a first step you'll need to:
123125
1. Navigate to the [Azure portal](https://portal.azure.com) and select the **Azure AD** service.
124126
1. Select the **App Registrations** blade on the left, then select **New registration**.
125127
1. In the **Register an application page** that appears, enter your application's registration information:
126-
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `WebApp`.
128+
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `ms-identity-nodejs-webapp`.
127129
- Under **Supported account types**, select **Accounts in this organizational directory only**.
128130
- In the **Redirect URI (optional)** section, select **Web** in the combo-box and enter the following redirect URI: `http://localhost:4000/redirect`.
129131
1. Select **Register** to create the application.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Here we build on the concepts we learnt earlier to authenticate users and acquir
8383

8484
## We'd love your feedback!
8585

86-
Were we successful in addressing your learning objective? Consider taking a moment to [share your experience with us]().
86+
Were we successful in addressing your learning objective? Consider taking a moment to [share your experience with us][(](https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR73pcsbpbxNJuZCMKN0lURpUQkRCSVdRSk8wUjdZSkg2NEZGOFFaTkxQVyQlQCN0PWcu)).
8787

8888
## More information
8989

0 commit comments

Comments
 (0)