diff --git a/IdAceCodeEditor/Config/appsettings.json b/IdAceCodeEditor/Config/appsettings.json index 73b5625..1287ce8 100644 --- a/IdAceCodeEditor/Config/appsettings.json +++ b/IdAceCodeEditor/Config/appsettings.json @@ -2,10 +2,10 @@ "Frameworks": [ { "Name": ".NETCORE", - "DisplayName": ".NET Core Samples", + "DisplayName": "ASP.NET Core", "Samples": [ { - "Name": "Sign In Users", + "Name": "Sign in users in webapp", "Type": "ASP.NETCOREWEB", "DisplayName": "An ASP.NET Core Web app signing-in users with the Microsoft identity platform in your organization", "WorkingFolder": "1-WebApp-OIDC\\1-1-MyOrg", @@ -93,7 +93,7 @@ ] }, { - "Name": "Call Microsoft Graph", + "Name": "Web app caling graph API", "Type": "ASP.NETCOREWEB", "DisplayName": "Enable your ASP.NET Core web app to sign in users and call Microsoft Graph with the Microsoft identity platform", "WorkingFolder": "2-WebApp-graph-user\\2-1-Call-MSGraph", @@ -189,7 +189,7 @@ ] }, { - "Name": "Web App Calling Web API", + "Name": "Webapp calling custom .NET core web API", "Type": "ASP.NETCOREWEB", "DisplayName": "How to secure an ASP.NET Core Web API with the Microsoft identity platform", "WorkingFolder": "4-WebApp-your-API\\4-1-MyOrg", @@ -371,10 +371,10 @@ }, { "Name": ".NET Framework", - "DisplayName": ".NET framework Samples", + "DisplayName": "ASP.NET framework", "Samples": [ { - "Name": "Sign In Users", + "Name": "Sign in users in webapp", "Type": "ASP.NETFRAMEWORK", "DisplayName": "Sign in a user in an ASP.NET Web App with OpenID Connect and the Microsoft identity platform", "WorkingFolder": "", @@ -450,7 +450,7 @@ ] }, { - "Name": "Web app caling Graph API", + "Name": "Web app caling graph API", "Type": "ASP.NETFRAMEWORK", "DisplayName": "Use OpenID Connect to sign in users to Microsoft identity platform and execute Microsoft Graph operations using incremental consent", "WorkingFolder": "", @@ -708,7 +708,7 @@ }, { "Name": "Blazor Server", - "DisplayName": "Blazor Server", + "DisplayName": "Blazor webapp", "Samples": [ { "Name": "Sign In Users", @@ -891,12 +891,190 @@ "DownloadLink": "https://visualstudio.microsoft.com/downloads/" } ] + }, + { + "Name": "Blazor Webapp calling custom ASP.NET core web API", + "Type": "BlazorServer", + "DisplayName": "Enable your Blazor Server to sign-in users and call Web API with the Microsoft identity platform", + "WorkingFolder": "WebApp-your-API\\MyOrg", + "Tags": [ + { "Name": "Blazor Sever" }, + { "Name": "Asp.Net Core" }, + { "Name": "Identity.Web" }, + { "Name": "Auth Code Flow" } + ], + "GitHubRepoSettings": { + "ReadMeLink": "https://github.com/Azure-Samples/ms-identity-blazor-server/tree/main/WebApp-your-API/MyOrg", + "TutorialLink": "https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-blazor-server", + "ClonePath": "https://github.com/Azure-Samples/ms-identity-blazor-server.git", + "LocalPath": "BlazorServer\\WebAppToAPI" + }, + "Projects": [ + { + "Name": "API Project", + "ProjectPath": "WebApp-your-API\\MyOrg\\Service", + "Order": "0", + "PortalSettings": { + "DisplayName": "ToDoListService-aspnetcore", + "SignInAudience": "AzureADMyOrg", + "AppType": "Api", + "IsHybridFlow": "", + "IsDeviceCodeFlow": "", + "SecretName": "", + "Certificate": "", + "RequiredResourceAccesss": [ + { + "ResourceAppId": "00000003-0000-0000-c000-000000000000", + "ResourceAccesss": [ + { + "Id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", + "Type": "Scope" + } + ] + } + ], + "PermissionScopes": [ + { + "Value": "access_as_user", + "Type": "User", + "AdminConsentDisplayName": "Access ToDoListService-aspnetcore", + "UserConsentDisplayName": "Access ToDoListService-aspnetcore", + "AdminConsentDescription": "Allows the app to access ToDoListService-aspnetcore as the signed-in user.", + "UserConsentDescription": "Allow the application to access ToDoListService-aspnetcore on your behalf." + } + ] + }, + "ReplacementFields": [ + { + "Name": "ClientId", + "ReplacementType": "JSON", + "Section": "AzureAd", + "Format": "", + "Source": "persistdata:Projects[0].App.AppId", + "Destination": "ClientId", + "FileName": "appsettings.json" + }, + { + "Name": "TenantId", + "ReplacementType": "JSON", + "Section": "AzureAd", + "Format": "", + "Source": "persistdata:Projects[0].TenantId", + "Destination": "TenantId", + "FileName": "appsettings.json" + }, + { + "Name": "Domain", + "ReplacementType": "JSON", + "Section": "AzureAd", + "Format": "", + "Source": "persistdata:Projects[0].Domain", + "Destination": "Domain", + "FileName": "appsettings.json" + } + ] + }, + { + "Name": "Client Project", + "ProjectPath": "WebApp-your-API\\MyOrg\\Client", + "Order": "1", + "PortalSettings": { + "DisplayName": "WebApp-calls-API-blazor-server", + "SignInAudience": "AzureADMyOrg", + "AppType": "Web", + "RedirectUri": "https://localhost:44318/signin-oidc", + "IsHybridFlow": "True", + "IsDeviceCodeFlow": "", + "SecretName": "mySecret", + "Certificate": "", + "RequiredResourceAccesss": [ + { + "ResourceAppId": "00000003-0000-0000-c000-000000000000", + "ResourceAccesss": [ + { + "Id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", + "Type": "Scope" + } + ] + + }, + { + "ResourceAppId": "persistdata:Projects[0].App.AppId", + "ResourceAccesss": [ + { + "Id": "persistdata:Projects[0].PermissionScopes[0].Id", + "Type": "Scope" + } + ] + + } + ] + }, + "ReplacementFields": [ + { + "Name": "ClientId", + "ReplacementType": "JSON", + "Section": "AzureAd", + "Source": "persistdata:Projects[1].App.AppId", + "Destination": "ClientId", + "FileName": "appsettings.json" + }, + { + "Name": "TenantId", + "Section": "AzureAd", + "ReplacementType": "JSON", + "Source": "persistdata:Projects[1].TenantId", + "Destination": "TenantId", + "FileName": "appsettings.json" + }, + { + "Name": "Domain", + "Section": "AzureAd", + "ReplacementType": "JSON", + "Source": "persistdata:Projects[1].Domain", + "Destination": "Domain", + "FileName": "appsettings.json" + }, + { + "Name": "ClientSecret", + "Section": "AzureAd", + "ReplacementType": "JSON", + "Source": "persistdata:Projects[1].SecretText", + "Destination": "ClientSecret", + "FileName": "appsettings.json" + }, + { + "Name": "TodoListScopes", + "Section": "TodoList", + "ReplacementType": "JSON", + "Format": "api://{0}/access_as_user", + "Source": "persistdata:Projects[0].App.AppId", + "Destination": "TodoListScope", + "FileName": "appsettings.json" + } + ] + } + ], + "Prerequisites": [ + { + "Name": "VSCode", + "DownloadLink": "https://code.visualstudio.com/download" + }, + { + "Name": "DotNetCore", + "DownloadLink": "https://dotnet.microsoft.com/en-us/download/dotnet/3.1" + }, + { + "Name": "VisualStudio", + "DownloadLink": "https://visualstudio.microsoft.com/downloads/" + } + ] } ] }, { "Name": "Angular", - "DisplayName": "Angular Samples", + "DisplayName": "Angular", "Samples": [ { "Name": "Sign In Users", @@ -1065,39 +1243,33 @@ "DownloadLink": "https://docs.npmjs.com/downloading-and-installing-node-js-and-npm" } ] - } - ] - }, - { - "Name": "React", - "DisplayName": "React Samples", - "Samples": [ + }, { - "Name": "Sign In Users", - "Type": "React", - "DisplayName": "React single-page application using MSAL React to sign-in users against Azure Active Directory", - "WorkingFolder": "1-Authentication\\1-sign-in\\SPA", + "Name": "SPA calling .NET core API", + "Type": "Angular", + "DisplayName": "Angular single-page application using MSAL Angular to sign-in users with Azure Active Directory and call a .NET Core web API", + "WorkingFolder": "3-Authorization-II\\1-call-api", "Tags": [ { "Name": "Spa" }, - { "Name": "MSAL React" }, + { "Name": "MSAL Angular" }, { "Name": "PKCE" } ], "GitHubRepoSettings": { - "ReadMeLink": "https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/blob/main/1-Authentication/1-sign-in/README.md", - "TutorialLink": "https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-react", - "ClonePath": "https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial.git", - "LocalPath": "React\\SignIn" + "ReadMeLink": "https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/3-Authorization-II/1-call-api", + "TutorialLink": "https://docs.microsoft.com/en-us/azure/active-directory/develop/single-page-app-quickstart?pivots=devlang-angular", + "ClonePath": "https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial.git", + "LocalPath": "Angular\\SpaCallingGraph" }, "Projects": [ { - "Name": "Client Project", - "ProjectPath": "1-Authentication\\1-sign-in", + "Name": "API Project", + "ProjectPath": "3-Authorization-II\\1-call-api", "Order": "0", "PortalSettings": { - "DisplayName": "msal-react-spa", + "DisplayName": "msal-dotnet-api", "SignInAudience": "AzureADMyOrg", - "AppType": "Spa", - "RedirectUri": "http://localhost:3000/", + "AppType": "Api", + "RedirectUri": "", "IsHybridFlow": "", "IsDeviceCodeFlow": "", "SecretName": "", @@ -1112,73 +1284,57 @@ } ] } + ], + "PermissionScopes": [ + { + "Value": "access_as_user", + "Type": "User", + "AdminConsentDisplayName": "Access msal-dotnet-api", + "UserConsentDisplayName": "Access msal-dotnet-api", + "AdminConsentDescription": "Allows the app to access msal-dotnet-api as the signed-in user", + "UserConsentDescription": "Allow the application to access msal-dotnet-api on your behalf." + } ] }, "ReplacementFields": [ { "Name": "ClientId", - "ReplacementType": "TXT", + "ReplacementType": "JSON", + "Section": "AzureAd", "Format": "", "Source": "persistdata:Projects[0].App.AppId", - "Destination": "Enter_the_Application_Id_Here", - "FileName": "SPA\\src\\authConfig.js" + "Destination": "ClientId", + "FileName": "API\\TodoListAPI\\appsettings.json" }, { "Name": "TenantId", - "ReplacementType": "TXT", + "ReplacementType": "JSON", + "Section": "AzureAd", "Format": "", "Source": "persistdata:Projects[0].TenantId", - "Destination": "Enter_the_Tenant_Info_Here", - "FileName": "SPA\\src\\authConfig.js" + "Destination": "TenantId", + "FileName": "API\\TodoListAPI\\appsettings.json" }, { - "Name": "redirectURi", - "ReplacementType": "TXT", + "Name": "Domain", + "ReplacementType": "JSON", + "Section": "AzureAd", "Format": "", - "Source": "\"https://localhost:3000/\"", - "Destination": "\"/\"", - "FileName": "SPA\\src\\authConfig.js" + "Source": "persistdata:Projects[0].Domain", + "Destination": "Domain", + "FileName": "API\\TodoListAPI\\appsettings.json" } ] - } - ], - "Prerequisites": [ - { - "Name": "VSCode", - "DownloadLink": "https://code.visualstudio.com/download" }, - { - "Name": "NPM", - "DownloadLink": "https://docs.npmjs.com/downloading-and-installing-node-js-and-npm" - } - ] - }, - { - "Name": "SPA calling Graph API", - "Type": "React", - "DisplayName": "React single-page application using MSAL React to sign-in users and call Graph API against Azure Active Directory", - "WorkingFolder": "2-Authorization-I\\1-call-graph\\SPA", - "Tags": [ - { "Name": "Spa" }, - { "Name": "MSAL React" }, - { "Name": "PKCE" } - ], - "GitHubRepoSettings": { - "ReadMeLink": "https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/blob/main/2-Authorization-I/1-call-graph/README.md", - "TutorialLink": "https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-react", - "ClonePath": "https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial.git", - "LocalPath": "React\\SpaCallingGraph" - }, - "Projects": [ { "Name": "Client Project", - "ProjectPath": "2-Authorization-I\\1-call-graph", - "Order": "0", + "ProjectPath": "3-Authorization-II\\1-call-api", + "Order": "1", "PortalSettings": { - "DisplayName": "msal-react-spa", + "DisplayName": "msal-angular-spa", "SignInAudience": "AzureADMyOrg", "AppType": "Spa", - "RedirectUri": "http://localhost:3000/", + "RedirectUri": "https://localhost:4200/", "IsHybridFlow": "", "IsDeviceCodeFlow": "", "SecretName": "", @@ -1190,8 +1346,194 @@ { "Id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", "Type": "Scope" - }, - { + } + ] + }, + { + "ResourceAppId": "persistdata:Projects[0].App.AppId", + "ResourceAccesss": [ + { + "Id": "persistdata:Projects[0].PermissionScopes[0].Id", + "Type": "Scope" + } + ] + + } + ] + }, + "ReplacementFields": [ + { + "Name": "ClientId", + "ReplacementType": "TXT", + "Format": "", + "Source": "persistdata:Projects[1].App.AppId", + "Destination": "Enter_the_Application_Id_Here", + "FileName": "SPA\\src\\app\\auth-config.ts" + }, + { + "Name": "TenantId", + "ReplacementType": "TXT", + "Format": "", + "Source": "persistdata:Projects[1].TenantId", + "Destination": "Enter_the_Tenant_Info_Here", + "FileName": "SPA\\src\\app\\auth-config.ts" + }, + { + "Name": "redirectURi", + "ReplacementType": "TXT", + "Format": "", + "Source": "'https://localhost:4200/'", + "Destination": "'/'", + "FileName": "SPA\\src\\app\\auth-config.ts" + }, + { + "Name": "ApiScope", + "ReplacementType": "TXT", + "Format": "api://{0}/access_as_user", + "Source": "persistdata:Projects[0].App.AppId", + "Destination": "Enter_the_Web_Api_Scope_here", + "FileName": "SPA\\src\\app\\auth-config.ts" + } + ] + } + ], + "Prerequisites": [ + { + "Name": "VSCode", + "DownloadLink": "https://code.visualstudio.com/download" + }, + { + "Name": "NPM", + "DownloadLink": "https://docs.npmjs.com/downloading-and-installing-node-js-and-npm" + } + ] + } + ] + }, + { + "Name": "React", + "DisplayName": "React", + "Samples": [ + { + "Name": "Sign In Users", + "Type": "React", + "DisplayName": "React single-page application using MSAL React to sign-in users against Azure Active Directory", + "WorkingFolder": "1-Authentication\\1-sign-in\\SPA", + "Tags": [ + { "Name": "Spa" }, + { "Name": "MSAL React" }, + { "Name": "PKCE" } + ], + "GitHubRepoSettings": { + "ReadMeLink": "https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/blob/main/1-Authentication/1-sign-in/README.md", + "TutorialLink": "https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-react", + "ClonePath": "https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial.git", + "LocalPath": "React\\SignIn" + }, + "Projects": [ + { + "Name": "Client Project", + "ProjectPath": "1-Authentication\\1-sign-in", + "Order": "0", + "PortalSettings": { + "DisplayName": "msal-react-spa", + "SignInAudience": "AzureADMyOrg", + "AppType": "Spa", + "RedirectUri": "http://localhost:3000/", + "IsHybridFlow": "", + "IsDeviceCodeFlow": "", + "SecretName": "", + "Certificate": "", + "RequiredResourceAccesss": [ + { + "ResourceAppId": "00000003-0000-0000-c000-000000000000", + "ResourceAccesss": [ + { + "Id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", + "Type": "Scope" + } + ] + } + ] + }, + "ReplacementFields": [ + { + "Name": "ClientId", + "ReplacementType": "TXT", + "Format": "", + "Source": "persistdata:Projects[0].App.AppId", + "Destination": "Enter_the_Application_Id_Here", + "FileName": "SPA\\src\\authConfig.js" + }, + { + "Name": "TenantId", + "ReplacementType": "TXT", + "Format": "", + "Source": "persistdata:Projects[0].TenantId", + "Destination": "Enter_the_Tenant_Info_Here", + "FileName": "SPA\\src\\authConfig.js" + }, + { + "Name": "redirectURi", + "ReplacementType": "TXT", + "Format": "", + "Source": "\"https://localhost:3000/\"", + "Destination": "\"/\"", + "FileName": "SPA\\src\\authConfig.js" + } + ] + } + ], + "Prerequisites": [ + { + "Name": "VSCode", + "DownloadLink": "https://code.visualstudio.com/download" + }, + { + "Name": "NPM", + "DownloadLink": "https://docs.npmjs.com/downloading-and-installing-node-js-and-npm" + } + ] + }, + { + "Name": "SPA calling Graph API", + "Type": "React", + "DisplayName": "React single-page application using MSAL React to sign-in users and call Graph API against Azure Active Directory", + "WorkingFolder": "2-Authorization-I\\1-call-graph\\SPA", + "Tags": [ + { "Name": "Spa" }, + { "Name": "MSAL React" }, + { "Name": "PKCE" } + ], + "GitHubRepoSettings": { + "ReadMeLink": "https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/blob/main/2-Authorization-I/1-call-graph/README.md", + "TutorialLink": "https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-react", + "ClonePath": "https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial.git", + "LocalPath": "React\\SpaCallingGraph" + }, + "Projects": [ + { + "Name": "Client Project", + "ProjectPath": "2-Authorization-I\\1-call-graph", + "Order": "0", + "PortalSettings": { + "DisplayName": "msal-react-spa", + "SignInAudience": "AzureADMyOrg", + "AppType": "Spa", + "RedirectUri": "http://localhost:3000/", + "IsHybridFlow": "", + "IsDeviceCodeFlow": "", + "SecretName": "", + "Certificate": "", + "RequiredResourceAccesss": [ + { + "ResourceAppId": "00000003-0000-0000-c000-000000000000", + "ResourceAccesss": [ + { + "Id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", + "Type": "Scope" + }, + { "Id": "570282fd-fa5c-430d-a7fd-fc8dc98a9dca", //Mail.Read "Type": "Scope" } @@ -1246,15 +1588,490 @@ "DownloadLink": "https://docs.npmjs.com/downloading-and-installing-node-js-and-npm" } ] + }, + { + "Name": "SPA calling NodeJS API", + "Type": "React", + "DisplayName": "A React single-page application using MSAL React to authorize users for calling a protected web API on Azure Active Directory", + "WorkingFolder": "3-Authorization-II\\1-call-api", + "Tags": [ + { "Name": "Spa" }, + { "Name": "MSAL React" }, + { "Name": "PKCE" } + ], + "GitHubRepoSettings": { + "ReadMeLink": "https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/tree/main/3-Authorization-II/1-call-api", + "TutorialLink": "https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-react", + "ClonePath": "https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial.git", + "LocalPath": "React\\SpaCallinApi" + }, + "Projects": [ + { + "Name": "API Project", + "ProjectPath": "3-Authorization-II\\1-call-api\\API", + "Order": "0", + "PortalSettings": { + "DisplayName": "msal-react-api", + "SignInAudience": "AzureADMyOrg", + "AppType": "Api", + "RedirectUri": "", + "IsHybridFlow": "", + "IsDeviceCodeFlow": "", + "SecretName": "", + "Certificate": "", + "RequiredResourceAccesss": [ + { + "ResourceAppId": "00000003-0000-0000-c000-000000000000", + "ResourceAccesss": [ + { + "Id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", + "Type": "Scope" + } + ] + } + ], + "PermissionScopes": [ + { + "Value": "access_as_user", + "Type": "User", + "AdminConsentDisplayName": "Access msal-react-api", + "UserConsentDisplayName": "Access msal-react-api", + "AdminConsentDescription": "Allows the app to access msal-react-api as the signed-in user", + "UserConsentDescription": "Allow the application to access msal-react-api on your behalf." + } + ] + }, + "ReplacementFields": [ + { + "Name": "ClientId", + "ReplacementType": "JSON", + "Section": "credentials", + "Format": "", + "Source": "persistdata:Projects[0].App.AppId", + "Destination": "clientID", + "FileName": "config.json" + }, + { + "Name": "TenantId", + "ReplacementType": "JSON", + "Section": "credentials", + "Format": "", + "Source": "persistdata:Projects[0].TenantId", + "Destination": "tenantID", + "FileName": "config.json" + } + ] + }, + { + "Name": "Client Project", + "ProjectPath": "3-Authorization-II\\1-call-api\\SPA", + "Order": "1", + "PortalSettings": { + "DisplayName": "msal-react-spa", + "SignInAudience": "AzureADMyOrg", + "AppType": "Spa", + "RedirectUri": "http://localhost:3000/", + "IsHybridFlow": "", + "IsDeviceCodeFlow": "", + "SecretName": "", + "Certificate": "", + "RequiredResourceAccesss": [ + { + "ResourceAppId": "00000003-0000-0000-c000-000000000000", + "ResourceAccesss": [ + { + "Id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", + "Type": "Scope" + } + ] + }, + { + "ResourceAppId": "persistdata:Projects[0].App.AppId", + "ResourceAccesss": [ + { + "Id": "persistdata:Projects[0].PermissionScopes[0].Id", + "Type": "Scope" + } + ] + + } + ] + }, + "ReplacementFields": [ + { + "Name": "ClientId", + "ReplacementType": "TXT", + "Format": "", + "Source": "persistdata:Projects[1].App.AppId", + "Destination": "Enter_the_Application_Id_Here", + "FileName": "src\\authConfig.js" + }, + { + "Name": "TenantId", + "ReplacementType": "TXT", + "Format": "", + "Source": "persistdata:Projects[1].TenantId", + "Destination": "Enter_the_Tenant_Info_Here", + "FileName": "src\\authConfig.js" + }, + { + "Name": "ApiScope", + "ReplacementType": "TXT", + "Format": "api://{0}/access_as_user", + "Source": "persistdata:Projects[0].App.AppId", + "Destination": "Enter_the_Web_Api_Scope_Here", + "FileName": "src\\authConfig.js" + } + ] + } + ], + "Prerequisites": [ + { + "Name": "VSCode", + "DownloadLink": "https://code.visualstudio.com/download" + }, + { + "Name": "NPM", + "DownloadLink": "https://docs.npmjs.com/downloading-and-installing-node-js-and-npm" + } + ] } ] }, { - "Name": "Python flask", - "DisplayName": "Python flask", + "Name": "Javascript", + "DisplayName": "Javascript", "Samples": [ { "Name": "Sign In Users", + "Type": "JS", + "DisplayName": "React single-page application using MSAL React to sign-in users against Azure Active Directory", + "WorkingFolder": "1-Authentication\\1-sign-in", + "Tags": [ + { "Name": "Spa" }, + { "Name": "MSAL JS" }, + { "Name": "PKCE" } + ], + "GitHubRepoSettings": { + "ReadMeLink": "https://github.com/Azure-Samples/ms-identity-javascript-tutorial/blob/main/1-Authentication/1-sign-in/README.md", + "TutorialLink": "https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-javascript-auth-code", + "ClonePath": "https://github.com/Azure-Samples/ms-identity-javascript-tutorial.git", + "LocalPath": "JS\\SignIn" + }, + "Projects": [ + { + "Name": "Client Project", + "ProjectPath": "1-Authentication\\1-sign-in", + "Order": "0", + "PortalSettings": { + "DisplayName": "ms-identity-javascript-tutorial-c1s1", + "SignInAudience": "AzureADMyOrg", + "AppType": "Spa", + "RedirectUri": "http://localhost:3000/", + "IsHybridFlow": "", + "IsDeviceCodeFlow": "", + "SecretName": "", + "Certificate": "", + "RequiredResourceAccesss": [ + { + "ResourceAppId": "00000003-0000-0000-c000-000000000000", + "ResourceAccesss": [ + { + "Id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", + "Type": "Scope" + } + ] + } + ] + }, + "ReplacementFields": [ + { + "Name": "ClientId", + "ReplacementType": "TXT", + "Format": "", + "Source": "persistdata:Projects[0].App.AppId", + "Destination": "Enter_the_Application_Id_Here", + "FileName": "App\\authConfig.js" + }, + { + "Name": "Authority", + "ReplacementType": "TXT", + "Format": "", + "Source": "persistdata:Projects[0].TenantId", + "Destination": "Enter_the_Tenant_Info_Here", + "FileName": "App\\authConfig.js" + }, + { + "Name": "redirectURi", + "ReplacementType": "TXT", + "Format": "", + "Source": "http://localhost:3000/", + "Destination": "Enter_the_Redirect_Uri_Here", + "FileName": "App\\authConfig.js" + } + ] + } + ], + "Prerequisites": [ + { + "Name": "VSCode", + "DownloadLink": "https://code.visualstudio.com/download" + }, + { + "Name": "NPM", + "DownloadLink": "https://docs.npmjs.com/downloading-and-installing-node-js-and-npm" + } + ] + }, + //{ + // "Name": "SPA calling Graph API", + // "Type": "React", + // "DisplayName": "React single-page application using MSAL React to sign-in users and call Graph API against Azure Active Directory", + // "WorkingFolder": "2-Authorization-I\\1-call-graph\\SPA", + // "Tags": [ + // { "Name": "Spa" }, + // { "Name": "MSAL React" }, + // { "Name": "PKCE" } + // ], + // "GitHubRepoSettings": { + // "ReadMeLink": "https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/blob/main/2-Authorization-I/1-call-graph/README.md", + // "TutorialLink": "https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-react", + // "ClonePath": "https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial.git", + // "LocalPath": "React\\SpaCallingGraph" + // }, + // "Projects": [ + // { + // "Name": "Client Project", + // "ProjectPath": "2-Authorization-I\\1-call-graph", + // "Order": "0", + // "PortalSettings": { + // "DisplayName": "msal-react-spa", + // "SignInAudience": "AzureADMyOrg", + // "AppType": "Spa", + // "RedirectUri": "http://localhost:3000/", + // "IsHybridFlow": "", + // "IsDeviceCodeFlow": "", + // "SecretName": "", + // "Certificate": "", + // "RequiredResourceAccesss": [ + // { + // "ResourceAppId": "00000003-0000-0000-c000-000000000000", + // "ResourceAccesss": [ + // { + // "Id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", + // "Type": "Scope" + // }, + // { + // "Id": "570282fd-fa5c-430d-a7fd-fc8dc98a9dca", //Mail.Read + // "Type": "Scope" + // } + // ] + // }, + // { + // "ResourceAppId": "797f4846-ba00-4fd7-ba43-dac1f8f63013", + // "ResourceAccesss": [ + // { + // "Id": "41094075-9dad-400e-a0bd-54e686782033", // Azure Service management User_impersonation + // "Type": "Scope" + // } + // ] + // } + // ] + // }, + // "ReplacementFields": [ + // { + // "Name": "ClientId", + // "ReplacementType": "TXT", + // "Format": "", + // "Source": "persistdata:Projects[0].App.AppId", + // "Destination": "Enter_the_Application_Id_Here", + // "FileName": "SPA\\src\\authConfig.js" + // }, + // { + // "Name": "TenantId", + // "ReplacementType": "TXT", + // "Format": "", + // "Source": "persistdata:Projects[0].TenantId", + // "Destination": "Enter_the_Tenant_Info_Here", + // "FileName": "SPA\\src\\authConfig.js" + // }, + // { + // "Name": "redirectURi", + // "ReplacementType": "TXT", + // "Format": "", + // "Source": "\"https://localhost:3000/\"", + // "Destination": "\"/\"", + // "FileName": "SPA\\src\\authConfig.js" + // } + // ] + // } + // ], + // "Prerequisites": [ + // { + // "Name": "VSCode", + // "DownloadLink": "https://code.visualstudio.com/download" + // }, + // { + // "Name": "NPM", + // "DownloadLink": "https://docs.npmjs.com/downloading-and-installing-node-js-and-npm" + // } + // ] + //}, + //{ + // "Name": "SPA calling NodeJS API", + // "Type": "React", + // "DisplayName": "A React single-page application using MSAL React to authorize users for calling a protected web API on Azure Active Directory", + // "WorkingFolder": "3-Authorization-II\\1-call-api", + // "Tags": [ + // { "Name": "Spa" }, + // { "Name": "MSAL React" }, + // { "Name": "PKCE" } + // ], + // "GitHubRepoSettings": { + // "ReadMeLink": "https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/tree/main/3-Authorization-II/1-call-api", + // "TutorialLink": "https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-react", + // "ClonePath": "https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial.git", + // "LocalPath": "React\\SpaCallinApi" + // }, + // "Projects": [ + // { + // "Name": "API Project", + // "ProjectPath": "3-Authorization-II\\1-call-api\\API", + // "Order": "0", + // "PortalSettings": { + // "DisplayName": "msal-react-api", + // "SignInAudience": "AzureADMyOrg", + // "AppType": "Api", + // "RedirectUri": "", + // "IsHybridFlow": "", + // "IsDeviceCodeFlow": "", + // "SecretName": "", + // "Certificate": "", + // "RequiredResourceAccesss": [ + // { + // "ResourceAppId": "00000003-0000-0000-c000-000000000000", + // "ResourceAccesss": [ + // { + // "Id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", + // "Type": "Scope" + // } + // ] + // } + // ], + // "PermissionScopes": [ + // { + // "Value": "access_as_user", + // "Type": "User", + // "AdminConsentDisplayName": "Access msal-react-api", + // "UserConsentDisplayName": "Access msal-react-api", + // "AdminConsentDescription": "Allows the app to access msal-react-api as the signed-in user", + // "UserConsentDescription": "Allow the application to access msal-react-api on your behalf." + // } + // ] + // }, + // "ReplacementFields": [ + // { + // "Name": "ClientId", + // "ReplacementType": "JSON", + // "Section": "credentials", + // "Format": "", + // "Source": "persistdata:Projects[0].App.AppId", + // "Destination": "clientID", + // "FileName": "config.json" + // }, + // { + // "Name": "TenantId", + // "ReplacementType": "JSON", + // "Section": "credentials", + // "Format": "", + // "Source": "persistdata:Projects[0].TenantId", + // "Destination": "tenantID", + // "FileName": "config.json" + // } + // ] + // }, + // { + // "Name": "Client Project", + // "ProjectPath": "3-Authorization-II\\1-call-api\\SPA", + // "Order": "1", + // "PortalSettings": { + // "DisplayName": "msal-react-spa", + // "SignInAudience": "AzureADMyOrg", + // "AppType": "Spa", + // "RedirectUri": "http://localhost:3000/", + // "IsHybridFlow": "", + // "IsDeviceCodeFlow": "", + // "SecretName": "", + // "Certificate": "", + // "RequiredResourceAccesss": [ + // { + // "ResourceAppId": "00000003-0000-0000-c000-000000000000", + // "ResourceAccesss": [ + // { + // "Id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", + // "Type": "Scope" + // } + // ] + // }, + // { + // "ResourceAppId": "persistdata:Projects[0].App.AppId", + // "ResourceAccesss": [ + // { + // "Id": "persistdata:Projects[0].PermissionScopes[0].Id", + // "Type": "Scope" + // } + // ] + + // } + // ] + // }, + // "ReplacementFields": [ + // { + // "Name": "ClientId", + // "ReplacementType": "TXT", + // "Format": "", + // "Source": "persistdata:Projects[1].App.AppId", + // "Destination": "Enter_the_Application_Id_Here", + // "FileName": "src\\authConfig.js" + // }, + // { + // "Name": "TenantId", + // "ReplacementType": "TXT", + // "Format": "", + // "Source": "persistdata:Projects[1].TenantId", + // "Destination": "Enter_the_Tenant_Info_Here", + // "FileName": "src\\authConfig.js" + // }, + // { + // "Name": "ApiScope", + // "ReplacementType": "TXT", + // "Format": "api://{0}/access_as_user", + // "Source": "persistdata:Projects[0].App.AppId", + // "Destination": "Enter_the_Web_Api_Scope_Here", + // "FileName": "src\\authConfig.js" + // } + // ] + // } + // ], + // "Prerequisites": [ + // { + // "Name": "VSCode", + // "DownloadLink": "https://code.visualstudio.com/download" + // }, + // { + // "Name": "NPM", + // "DownloadLink": "https://docs.npmjs.com/downloading-and-installing-node-js-and-npm" + // } + // ] + //} + ] + }, + { + "Name": "Python", + "DisplayName": "Python", + "Samples": [ + { + "Name": "Sign in users in python flask web app", "Type": "PythonFlask", "DisplayName": "Enable your Python Flask webapp to sign in users to your Azure Active Directory tenant with the Microsoft identity platform", "WorkingFolder": "", @@ -1313,7 +2130,7 @@ "Source": "persistdata:Projects[0].TenantId", "Destination": "authority", "FileName": "aad.config.json" - }, + }, { "Name": "ClientSecret", "ReplacementType": "JSON", @@ -1334,7 +2151,169 @@ { "Name": "Python", "DownloadLink": "https://www.python.org/downloads/release/python-380/" - }, + } + ] + }, + { + "Name": "Python flask web app calling graph API", + "Type": "PythonFlask", + "DisplayName": "This sample demonstrates a Python web application calling a Microsoft Graph that is secured using Azure Active Directory.", + "WorkingFolder": "", + "Tags": [ + { "Name": "Web App" }, + { "Name": "Python Flask" }, + { "Name": "MSAL Python" }, + { "Name": "Auth Code Flow" } + ], + "GitHubRepoSettings": { + "ReadMeLink": "https://github.com/Azure-Samples/ms-identity-python-webapp", + "TutorialLink": "https://docs.microsoft.com/en-us/samples/azure-samples/ms-identity-python-webapp/ms-identity-python-webapp/", + "ClonePath": "https://github.com/Azure-Samples/ms-identity-python-webapp.git", + "LocalPath": "PythonFlask\\CallGraphAPI" + }, + "Projects": [ + { + "Name": "Client Project", + "ProjectPath": "", + "Order": "0", + "PortalSettings": { + "DisplayName": "python-webapp", + "SignInAudience": "AzureADandPersonalMicrosoftAccount", + "AppType": "Web", + "RedirectUri": "http://localhost:5000/getAToken", + "IsHybridFlow": "", + "IsDeviceCodeFlow": "", + "SecretName": "appsecret", + "Certificate": "", + "RequiredResourceAccesss": [ + { + "ResourceAppId": "00000003-0000-0000-c000-000000000000", + "ResourceAccesss": [ + { + "id": "b340eb25-3456-403f-be2f-af7a0d370277", + "Type": "Scope" + } + ] + } + ] + }, + "ReplacementFields": [ + { + "Name": "ClientId", + "ReplacementType": "TXT", + "Section": "client", + "Source": "persistdata:Projects[0].App.AppId", + "Destination": "Enter_the_Application_Id_here", + "FileName": "app_config.py" + }, + { + "Name": "ClientSecret", + "ReplacementType": "TXT", + "Section": "client", + "Format": "", + "Source": "persistdata:Projects[0].SecretText", + "Destination": "Enter_the_Client_Secret_Here", + "FileName": "app_config.py" + } + ] + } + ], + "Prerequisites": [ + { + "Name": "VSCode", + "DownloadLink": "https://code.visualstudio.com/download" + }, + { + "Name": "Python", + "DownloadLink": "https://www.python.org/downloads/release/python-380/" + } + ] + }, + { + "Name": "Daemon - Call Microsoft Graph with secret", + "Type": "Python", + "DisplayName": "A simple Python daemon console application calling Microsoft Graph with its own identity (client secret variation)", + "WorkingFolder": "1-Call-MsGraph-WithSecret", + "Tags": [ + { "Name": "Daemon" }, + { "Name": "Python" }, + { "Name": "MSAL Python" }, + { "Name": "Client credential flow" } + ], + "GitHubRepoSettings": { + "ReadMeLink": "https://github.com/Azure-Samples/ms-identity-python-daemon/tree/master/1-Call-MsGraph-WithSecret", + "TutorialLink": "https://docs.microsoft.com/en-us/azure/active-directory/develop/console-app-quickstart?pivots=devlang-python", + "ClonePath": "https://github.com/Azure-Samples/ms-identity-python-daemon.git", + "LocalPath": "Python\\daemonwithsecret" + }, + "Projects": [ + { + "Name": "Client Project", + "ProjectPath": "1-Call-MsGraph-WithSecret", + "Order": "0", + "PortalSettings": { + "DisplayName": "daemon-console", + "SignInAudience": "AzureADMyOrg", + "AppType": "Daemon", + "RedirectUri": "", + "IsHybridFlow": "", + "IsDeviceCodeFlow": "", + "SecretName": "mysecret", + "Certificate": "", + "RequiredResourceAccesss": [ + { + "ResourceAppId": "00000003-0000-0000-c000-000000000000", + "ResourceAccesss": [ + { + "Id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", + "Type": "Scope" + }, + { + "id": "df021288-bdef-4463-88db-98f22de89214", + "type": "Role" + } + ] + } + ] + }, + "ReplacementFields": [ + { + "Name": "Authority", + "ReplacementType": "JSON", + "Section": "", + "Source": "persistdata:Projects[0].TenantId", + "Format": "https://login.microsoftonline.com/{0}", + "Destination": "authority", + "FileName": "parameters.json" + }, + { + "Name": "ClientId", + "ReplacementType": "JSON", + "Section": "", + "Source": "persistdata:Projects[0].App.AppId", + "Destination": "client_id", + "FileName": "parameters.json" + }, + { + "Name": "ClientSecret", + "ReplacementType": "JSON", + "Section": "", + "Source": "persistdata:Projects[0].SecretText", + "Destination": "secret", + "FileName": "parameters.json" + } + ] + } + ], + "Prerequisites": [ + { + "Name": "VSCode", + "DownloadLink": "https://code.visualstudio.com/download" + }, + { + "Name": "Python", + "DownloadLink": "https://www.python.org/downloads/release/python-380/" + } ] } ] diff --git a/IdAceCodeEditor/Services/ConfigureAzureAdApp.cs b/IdAceCodeEditor/Services/ConfigureAzureAdApp.cs index 8c1d566..57c89e8 100644 --- a/IdAceCodeEditor/Services/ConfigureAzureAdApp.cs +++ b/IdAceCodeEditor/Services/ConfigureAzureAdApp.cs @@ -217,7 +217,16 @@ public async Task CreateAppRegistration() await graphClient.Applications[content.Id] .Request() - .UpdateAsync(content); + .UpdateAsync(content); + + var servicePrincipal = new ServicePrincipal + { + AppId = content.AppId, + }; + + await graphClient. + ServicePrincipals. + Request().AddAsync(servicePrincipal); } return content; } diff --git a/IdAceCodeEditor/Services/ReplaceService.cs b/IdAceCodeEditor/Services/ReplaceService.cs index 4854281..d397dce 100644 --- a/IdAceCodeEditor/Services/ReplaceService.cs +++ b/IdAceCodeEditor/Services/ReplaceService.cs @@ -55,6 +55,8 @@ private bool UpdateJsonwithvalues(string jsonFileName, { p[dest] = value; } + else + jObject[dest] = value; string newJson = JsonConvert.SerializeObject(jObject); diff --git a/IdAceCodeEditor/ViewModels/AutoViewModel.cs b/IdAceCodeEditor/ViewModels/AutoViewModel.cs index 87a17e1..78dc5d8 100644 --- a/IdAceCodeEditor/ViewModels/AutoViewModel.cs +++ b/IdAceCodeEditor/ViewModels/AutoViewModel.cs @@ -22,8 +22,11 @@ public AutoViewModel(Project sampleProject) foreach (var item in SampleProject.PortalSettings.GetType().GetProperties()) { - if(item.PropertyType.Name.Equals("String")) - AppListSettings.Add(new AppSettingList(item.Name, item.GetValue(SampleProject.PortalSettings, null).ToString())); + if (item.PropertyType.Name.Equals("String")) + { + if(item.GetValue(SampleProject.PortalSettings, null)!=null) + AppListSettings.Add(new AppSettingList(item.Name, item.GetValue(SampleProject.PortalSettings, null).ToString())); + } } } private ICommand _createAppCommand;