Skip to content

Commit 15b07d5

Browse files
committed
adding apps.json
1 parent 559eb7a commit 15b07d5

File tree

5 files changed

+100
-61
lines changed

5 files changed

+100
-61
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Credentials
2-
TENANT_ID=Enter_the_Tenant_Id_Here
2+
TENANT_ID=Enter_the_Tenant_Info_Here
33
CLIENT_ID=Enter_the_Application_Id_Here
44
CLIENT_SECRET=Enter_the_Client_Secret_Here
55

AppCreationScripts/Configure.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ Function ConfigureApplications
235235
# Update config file for 'client'
236236
$configFile = $pwd.Path + "\..\.env"
237237
Write-Host "Updating the sample code ($configFile)"
238-
$dictionary = @{ "Enter_the_Tenant_Id_Here" = $tenantId;"Enter_the_Application_Id_Here" = $clientAadApplication.AppId;"Enter_the_Client_Secret_Here" = $clientAppKey;"Enter_the_Cloud_Instance_Id_Here" = 'https://login.microsoftonline.com/';"Enter_the_Graph_Endpoint_Here" = 'https://graph.microsoft.com/' };
238+
$dictionary = @{ "Enter_the_Tenant_Info_Here" = $tenantId;"Enter_the_Application_Id_Here" = $clientAadApplication.AppId;"Enter_the_Client_Secret_Here" = $clientAppKey;"Enter_the_Cloud_Instance_Id_Here" = 'https://login.microsoftonline.com/';"Enter_the_Graph_Endpoint_Here" = 'https://graph.microsoft.com/' };
239239
ReplaceInTextFile -configFilePath $configFile -dictionary $dictionary
240240
Write-Host ""
241241
Write-Host -ForegroundColor Green "------------------------------------------------------------------------------------------------"

AppCreationScripts/apps.json

Lines changed: 37 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,39 @@
11
{
2-
"Sample": {
3-
"Title": "A Node.js console application secured by MSAL Node on Microsoft identity platform",
4-
"Level": 200,
5-
"Client": "Node.js console app",
6-
"Service": "Microsoft Graph",
7-
"RepositoryUrl": "ms-identity-javascript-nodejs-console",
8-
"Endpoint": "AAD v2.0"
9-
},
10-
"AADApps": [
11-
{
12-
"Id": "client",
13-
"Name": "msal-node-console",
14-
"Kind": "Daemon",
15-
"Audience": "AzureADMyOrg",
16-
"PasswordCredentials": "Auto",
17-
"RequiredResourcesAccess": [
18-
{
19-
"Resource": "Microsoft Graph",
20-
"ApplicationPermissions": [ "User.Read.All" ]
2+
"Sample": {
3+
"Title": "A Node.js console application secured by MSAL Node on Microsoft identity platform",
4+
"Level": 200,
5+
"Client": "Node.js console app"
6+
},
7+
"AppRegistrations": [
8+
{
9+
"x-ms-id": "client",
10+
"x-ms-name": "msal-node-console",
11+
"x-ms-version": "2.0",
12+
"requiredResourceAccess": [
13+
{
14+
"x-ms-resourceAppName": "Microsoft Graph",
15+
"resourceAppId": "00000003-0000-0000-c000-000000000000",
16+
"resourceAccess": [
17+
{
18+
"id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d",
19+
"type": "Scope",
20+
"x-ms-name": "User.Read.All"
21+
}
22+
]
23+
}
24+
],
25+
"codeConfigurations": [
26+
{
27+
"settingFile": "/.env",
28+
"replaceTokens": {
29+
"appId": "Enter_the_Application_Id_Here",
30+
"tenantId": "Enter_the_Tenant_Info_Here",
31+
"clientSecret": "Enter_the_Client_Secret_Here",
32+
"authorityEndpointHost": "Enter_the_Cloud_Instance_Id_Here",
33+
"msgraphEndpointHost": "Enter_the_Graph_Endpoint_Here"
2134
}
22-
],
23-
"ManualSteps": [
24-
{
25-
"Comment" : "Navigate to the API permissions page and click on 'Grant admin consent for {tenant}'"
26-
}
27-
]
28-
}
29-
],
30-
"CodeConfiguration": [
31-
{
32-
"App": "client",
33-
"SettingKind": "Replace",
34-
"SettingFile": "\\..\\.env",
35-
"Mappings": [
36-
{
37-
"key": "Enter_the_Tenant_Id_Here",
38-
"value": "$tenantId"
39-
},
40-
{
41-
"key": "Enter_the_Application_Id_Here",
42-
"value": ".AppId"
43-
},
44-
{
45-
"key": "Enter_the_Client_Secret_Here",
46-
"value": ".AppKey"
47-
},
48-
{
49-
"key": "Enter_the_Cloud_Instance_Id_Here",
50-
"value": "'https://login.microsoftonline.com/'"
51-
},
52-
{
53-
"key": "Enter_the_Graph_Endpoint_Here",
54-
"value": "'https://graph.microsoft.com/'"
55-
}
56-
]
57-
}
58-
]
59-
}
35+
}
36+
]
37+
}
38+
]
39+
}

AppCreationScripts/sample.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"Sample": {
3+
"Title": "A Node.js console application secured by MSAL Node on Microsoft identity platform",
4+
"Level": 200,
5+
"Client": "Node.js console app",
6+
"Service": "Microsoft Graph",
7+
"RepositoryUrl": "ms-identity-javascript-nodejs-console",
8+
"Endpoint": "AAD v2.0"
9+
},
10+
"AADApps": [
11+
{
12+
"Id": "client",
13+
"Name": "msal-node-console",
14+
"Kind": "Daemon",
15+
"Audience": "AzureADMyOrg",
16+
"PasswordCredentials": "Auto",
17+
"RequiredResourcesAccess": [
18+
{
19+
"Resource": "Microsoft Graph",
20+
"ApplicationPermissions": [ "User.Read.All" ]
21+
}
22+
],
23+
"ManualSteps": [
24+
{
25+
"Comment" : "Navigate to the API permissions page and click on 'Grant admin consent for {tenant}'"
26+
}
27+
]
28+
}
29+
],
30+
"CodeConfiguration": [
31+
{
32+
"App": "client",
33+
"SettingKind": "Replace",
34+
"SettingFile": "\\..\\.env",
35+
"Mappings": [
36+
{
37+
"key": "Enter_the_Tenant_Info_Here",
38+
"value": "$tenantId"
39+
},
40+
{
41+
"key": "Enter_the_Application_Id_Here",
42+
"value": ".AppId"
43+
},
44+
{
45+
"key": "Enter_the_Client_Secret_Here",
46+
"value": ".AppKey"
47+
},
48+
{
49+
"key": "Enter_the_Cloud_Instance_Id_Here",
50+
"value": "'https://login.microsoftonline.com/'"
51+
},
52+
{
53+
"key": "Enter_the_Graph_Endpoint_Here",
54+
"value": "'https://graph.microsoft.com/'"
55+
}
56+
]
57+
}
58+
]
59+
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ This sample demonstrates the following **MSAL Node** concepts:
4646
2. Select **Grant admin consent for {tenant}**.
4747
1. Clone this repository `git clone https://github.com/Azure-Samples/ms-identity-javascript-nodejs-console.git`
4848
1. Open the [.env](.env) file and provide the required configuration values.
49-
1. Replace the string `Enter_the_Tenant_Id_Here` with your tenant ID on Azure AD portal.
49+
1. Replace the string `Enter_the_Tenant_Info_Here` with your tenant ID on Azure AD portal.
5050
2. Replace the string `Enter_the_Application_Id_Here` with your app/client ID on Azure AD portal.
5151
3. Replace the string `Enter_the_Client_Secret_Here` with the client secret you created on Azure AD portal.
5252
4. Replace the string `Enter_the_Cloud_Instance_Id_Here` with `https://login.microsoftonline.com/` (see **note** below).
5353
5. Replace the string `Enter_the_Graph_Endpoint_Here`. with `https://graph.microsoft.com/` (see **note** below).
5454

5555
> :information_source: *note*: This is for multi-tenant applications located on the global Azure cloud. For more information, see: [Use MSAL in a national cloud environment](https://docs.microsoft.com/azure/active-directory/develop/quickstart-v2-javascript-auth-code)
5656
57-
> :information_source: *note*: This is for MS Graph instance located on the global Azure cloud. For more information, see: [Use Microsoft Graph in a national cloud environment](https://docs.microsoft.com/en-us/graph/deployments)
57+
> :information_source: *note*: This is for MS Graph instance located on the global Azure cloud. For more information, see: [Use Microsoft Graph in a national cloud environment](https://docs.microsoft.com/graph/deployments)
5858
5959
1. On the command line, navigate to the root of the repository, and type `npm install`.
6060

0 commit comments

Comments
 (0)