From c5b7c1a593bc85c37fcdacef85888c01079ea005 Mon Sep 17 00:00:00 2001 From: Jean-Marc Prieur Date: Mon, 19 Apr 2021 16:23:10 +0200 Subject: [PATCH 1/2] Update appsettings.json --- ProjectTemplates/templates/WebApi-CSharp/appsettings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProjectTemplates/templates/WebApi-CSharp/appsettings.json b/ProjectTemplates/templates/WebApi-CSharp/appsettings.json index e0d2dcb4c..9819a5d75 100644 --- a/ProjectTemplates/templates/WebApi-CSharp/appsettings.json +++ b/ProjectTemplates/templates/WebApi-CSharp/appsettings.json @@ -3,7 +3,7 @@ // "AzureAdB2C": { // "Instance": "https:////yourDomain.b2clogin.com/", // "ClientId": "11111111-1111-1111-11111111111111111", -// "Domain": "yourDomain.onmicrosoft.com", +// "Domain": "qualified.domain.name", //#if (GenerateApi) // "ClientSecret": "secret-from-app-registration", // "ClientCertificates" : [ @@ -17,7 +17,7 @@ //#if (!SingleOrgAuth) // "TenantId": "common", //#else -// "Domain": "yourDomain", +// "Domain": "qualified.domain.name", // "TenantId": "22222222-2222-2222-2222-222222222222", //#endif // "ClientId": "11111111-1111-1111-11111111111111111", From b314ea8fa591d30d0d596bb56e85d689f66e6624 Mon Sep 17 00:00:00 2001 From: jennyf19 Date: Tue, 20 Apr 2021 08:50:21 -0700 Subject: [PATCH 2/2] fix domain issue for other templates (#1150) --- ProjectTemplates/configuration.json | 2 +- .../.template.config/template.json | 6 +- .../BlazorServerWeb-CSharp/appsettings.json | 6 +- .../.template.config/template.json | 2 +- .../Client/Program.cs | 2 +- .../Server/appsettings.json | 4 +- .../.template.config/template.json | 6 +- .../Functions-CSharp/appsettings.json | 6 +- .../.template.config/template.json | 6 +- .../RazorPagesWeb-CSharp/appsettings.json | 6 +- .../.template.config/template.json | 6 +- .../StarterWeb-CSharp/appsettings.json | 6 +- .../.template.config/template.json | 6 +- .../templates/WebApi-CSharp/appsettings.json | 2 +- .../.template.config/template.json | 6 +- .../templates/Worker-CSharp/appsettings.json | 102 +++++++++--------- 16 files changed, 87 insertions(+), 87 deletions(-) diff --git a/ProjectTemplates/configuration.json b/ProjectTemplates/configuration.json index b4f98e11b..adfe1cb44 100644 --- a/ProjectTemplates/configuration.json +++ b/ProjectTemplates/configuration.json @@ -225,7 +225,7 @@ "FileRelativePath": "Client/Program.cs", "Replacements": [ { - "ReplaceFrom": "https://yourDomain.onmicrosoft.com/api.id.uri/access_as_user", + "ReplaceFrom": "https://qualified.domain.name/api.id.uri/access_as_user", "ReplaceBy": "https://fabrikamb2c.onmicrosoft.com/helloapi/user_impersonation" } ] diff --git a/ProjectTemplates/templates/BlazorServerWeb-CSharp/.template.config/template.json b/ProjectTemplates/templates/BlazorServerWeb-CSharp/.template.config/template.json index d59dec5b6..e7e210b55 100644 --- a/ProjectTemplates/templates/BlazorServerWeb-CSharp/.template.config/template.json +++ b/ProjectTemplates/templates/BlazorServerWeb-CSharp/.template.config/template.json @@ -210,8 +210,8 @@ "AAdB2CInstance": { "type": "parameter", "datatype": "string", - "defaultValue": "https://yourDomain.b2clogin.com/", - "replaces": "https:////yourDomain.b2clogin.com/", + "defaultValue": "https://qualified.domain.name.b2clogin.com/", + "replaces": "https:////qualified.domain.name.b2clogin.com/", "description": "The Azure Active Directory B2C instance to connect to (use with IndividualB2C auth)." }, "SignUpSignInPolicyId": { @@ -258,7 +258,7 @@ "Domain": { "type": "parameter", "datatype": "string", - "replaces": "yourDomain", + "replaces": "qualified.domain.name", "description": "The domain for the directory tenant (use with SingleOrg or IndividualB2C auth)." }, "TenantId": { diff --git a/ProjectTemplates/templates/BlazorServerWeb-CSharp/appsettings.json b/ProjectTemplates/templates/BlazorServerWeb-CSharp/appsettings.json index 73f5d45fb..f5f7ae874 100644 --- a/ProjectTemplates/templates/BlazorServerWeb-CSharp/appsettings.json +++ b/ProjectTemplates/templates/BlazorServerWeb-CSharp/appsettings.json @@ -1,10 +1,10 @@ { ////#if (IndividualB2CAuth) // "AzureAdB2C": { -// "Instance": "https:////yourDomain.b2clogin.com/", +// "Instance": "https:////qualified.domain.name.b2clogin.com/", // "ClientId": "11111111-1111-1111-11111111111111111", // "CallbackPath": "/signin-oidc", -// "Domain": "yourDomain.onmicrosoft.com", +// "Domain": "qualified.domain.name", // "SignedOutCallbackPath": "/signout/MySignUpSignInPolicyId", //#if (GenerateApi) // "ClientSecret": "secret-from-app-registration", @@ -21,7 +21,7 @@ //#if (MultiOrgAuth) // "TenantId": "common", //#elseif (SingleOrgAuth) -// "Domain": "yourDomain", +// "Domain": "qualified.domain.name", // "TenantId": "22222222-2222-2222-2222-222222222222", //#endif // "ClientId": "11111111-1111-1111-11111111111111111", diff --git a/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/.template.config/template.json b/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/.template.config/template.json index 27e63f316..d318c4be0 100644 --- a/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/.template.config/template.json +++ b/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/.template.config/template.json @@ -363,7 +363,7 @@ "Domain": { "type": "parameter", "datatype": "string", - "replaces": "yourDomain", + "replaces": "qualified.domain.name", "description": "The domain for the directory tenant (use with SingleOrg or IndividualB2C auth)." }, "AppIDUri": { diff --git a/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/Client/Program.cs b/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/Client/Program.cs index 4ea2f1ec9..02dac7f0d 100644 --- a/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/Client/Program.cs +++ b/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/Client/Program.cs @@ -55,7 +55,7 @@ public static async Task Main(string[] args) { builder.Configuration.Bind("AzureAdB2C", options.ProviderOptions.Authentication); #if (Hosted) - options.ProviderOptions.DefaultAccessTokenScopes.Add("https://yourDomain.onmicrosoft.com/api.id.uri/api-scope"); + options.ProviderOptions.DefaultAccessTokenScopes.Add("https://qualified.domain.name/api.id.uri/api-scope"); #endif }); #endif diff --git a/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/Server/appsettings.json b/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/Server/appsettings.json index f56ec05ae..25fbc69c4 100644 --- a/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/Server/appsettings.json +++ b/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/Server/appsettings.json @@ -11,7 +11,7 @@ // "AzureAdB2C": { // "Instance": "https:////aadB2CInstance.b2clogin.com/", // "ClientId": "11111111-1111-1111-11111111111111111", -// "Domain": "yourDomain.onmicrosoft.com", +// "Domain": "qualified.domain.name", //#if (GenerateApi) // "ClientSecret": "secret-from-app-registration", // "ClientCertificates" : [ @@ -25,7 +25,7 @@ //#if (!SingleOrgAuth) // "TenantId": "common", //#else -// "Domain": "yourDomain", +// "Domain": "qualified.domain.name", // "TenantId": "22222222-2222-2222-2222-222222222222", //#endif // "ClientId": "11111111-1111-1111-11111111111111111", diff --git a/ProjectTemplates/templates/Functions-CSharp/.template.config/template.json b/ProjectTemplates/templates/Functions-CSharp/.template.config/template.json index 7e3a3d410..7d64e5add 100644 --- a/ProjectTemplates/templates/Functions-CSharp/.template.config/template.json +++ b/ProjectTemplates/templates/Functions-CSharp/.template.config/template.json @@ -40,8 +40,8 @@ "AAdB2CInstance": { "type": "parameter", "datatype": "string", - "defaultValue": "https://yourDomain.b2clogin.com/", - "replaces": "https:////yourDomain.b2clogin.com/", + "defaultValue": "https://qualified.domain.name.b2clogin.com/", + "replaces": "https:////qualified.domain.name.b2clogin.com/", "description": "The Azure Active Directory B2C instance to connect to (use with IndividualB2C auth)." }, "SignUpSignInPolicyId": { @@ -67,7 +67,7 @@ "Domain": { "type": "parameter", "datatype": "string", - "replaces": "yourDomain", + "replaces": "qualified.domain.name", "description": "The domain for the directory tenant (use with SingleOrg or IndividualB2C auth)." }, "DefaultScope": { diff --git a/ProjectTemplates/templates/Functions-CSharp/appsettings.json b/ProjectTemplates/templates/Functions-CSharp/appsettings.json index 0b9a59071..1965c4dba 100644 --- a/ProjectTemplates/templates/Functions-CSharp/appsettings.json +++ b/ProjectTemplates/templates/Functions-CSharp/appsettings.json @@ -1,9 +1,9 @@ { ////#if (IndividualB2CAuth) // "AzureAdB2C": { -// "Instance": "https:////yourDomain.b2clogin.com/", +// "Instance": "https:////qualified.domain.name.b2clogin.com/", // "ClientId": "11111111-1111-1111-11111111111111111", -// "Domain": "yourDomain.onmicrosoft.com", +// "Domain": "qualified.domain.name", //#if (GenerateApi) // "ClientSecret": "secret-from-app-registration", // "ClientCertificates" : [ @@ -17,7 +17,7 @@ //#if (!SingleOrgAuth) // "TenantId": "common", //#else -// "Domain": "yourDomain", +// "Domain": "qualified.domain.name", // "TenantId": "22222222-2222-2222-2222-222222222222", //#endif // "ClientId": "11111111-1111-1111-11111111111111111", diff --git a/ProjectTemplates/templates/RazorPagesWeb-CSharp/.template.config/template.json b/ProjectTemplates/templates/RazorPagesWeb-CSharp/.template.config/template.json index 8ed37c3a1..609513dce 100644 --- a/ProjectTemplates/templates/RazorPagesWeb-CSharp/.template.config/template.json +++ b/ProjectTemplates/templates/RazorPagesWeb-CSharp/.template.config/template.json @@ -134,8 +134,8 @@ "AAdB2CInstance": { "type": "parameter", "datatype": "string", - "defaultValue": "https://yourDomain.b2clogin.com/", - "replaces": "https:////yourDomain.b2clogin.com/", + "defaultValue": "https://qualified.domain.name.b2clogin.com/", + "replaces": "https:////qualified.domain.name.b2clogin.com/", "description": "The Azure Active Directory B2C instance to connect to (use with IndividualB2C auth)." }, "SignUpSignInPolicyId": { @@ -182,7 +182,7 @@ "Domain": { "type": "parameter", "datatype": "string", - "replaces": "yourDomain", + "replaces": "qualified.domain.name", "description": "The domain for the directory tenant (use with SingleOrg or IndividualB2C auth)." }, "TenantId": { diff --git a/ProjectTemplates/templates/RazorPagesWeb-CSharp/appsettings.json b/ProjectTemplates/templates/RazorPagesWeb-CSharp/appsettings.json index 72276026d..316b0f527 100644 --- a/ProjectTemplates/templates/RazorPagesWeb-CSharp/appsettings.json +++ b/ProjectTemplates/templates/RazorPagesWeb-CSharp/appsettings.json @@ -1,10 +1,10 @@ { ////#if (IndividualB2CAuth) // "AzureAdB2C": { -// "Instance": "https:////yourDomain.b2clogin.com/", +// "Instance": "https:////qualified.domain.name.b2clogin.com/", // "ClientId": "11111111-1111-1111-11111111111111111", // "CallbackPath": "/signin-oidc", -// "Domain": "yourDomain.onmicrosoft.com", +// "Domain": "qualified.domain.name", //#if (GenerateApi) // "ClientSecret": "secret-from-app-registration", // "ClientCertificates" : [ @@ -21,7 +21,7 @@ //#if (MultiOrgAuth) // "TenantId": "common", //#elseif (SingleOrgAuth) -// "Domain": "yourDomain", +// "Domain": "qualified.domain.name", // "TenantId": "22222222-2222-2222-2222-222222222222", //#endif // "ClientId": "11111111-1111-1111-11111111111111111", diff --git a/ProjectTemplates/templates/StarterWeb-CSharp/.template.config/template.json b/ProjectTemplates/templates/StarterWeb-CSharp/.template.config/template.json index 25c900109..d5f9caab2 100644 --- a/ProjectTemplates/templates/StarterWeb-CSharp/.template.config/template.json +++ b/ProjectTemplates/templates/StarterWeb-CSharp/.template.config/template.json @@ -130,8 +130,8 @@ "AAdB2CInstance": { "type": "parameter", "datatype": "string", - "defaultValue": "https://yourDomain.b2clogin.com/", - "replaces": "https:////yourDomain.b2clogin.com/", + "defaultValue": "https://qualified.domain.name.b2clogin.com/", + "replaces": "https:////qualified.domain.name.b2clogin.com/", "description": "The Azure Active Directory B2C instance to connect to (use with IndividualB2C auth)." }, "SignUpSignInPolicyId": { @@ -178,7 +178,7 @@ "Domain": { "type": "parameter", "datatype": "string", - "replaces": "yourDomain", + "replaces": "qualified.domain.name", "description": "The domain for the directory tenant (use with SingleOrg or IndividualB2C auth)." }, "TenantId": { diff --git a/ProjectTemplates/templates/StarterWeb-CSharp/appsettings.json b/ProjectTemplates/templates/StarterWeb-CSharp/appsettings.json index 1dcd9cb2a..67a9e60c9 100644 --- a/ProjectTemplates/templates/StarterWeb-CSharp/appsettings.json +++ b/ProjectTemplates/templates/StarterWeb-CSharp/appsettings.json @@ -1,9 +1,9 @@ { ////#if (IndividualB2CAuth) // "AzureAdB2C": { -// "Instance": "https:////yourDomain.b2clogin.com/", +// "Instance": "https:////qualified.domain.name.b2clogin.com/", // "ClientId": "11111111-1111-1111-11111111111111111", -// "Domain": "yourDomain.onmicrosoft.com", +// "Domain": "qualified.domain.name", // "SignedOutCallbackPath": "/signout/MySignUpSignInPolicyId", // "SignUpSignInPolicyId": "MySignUpSignInPolicyId", // "ResetPasswordPolicyId": "MyResetPasswordPolicyId", @@ -21,7 +21,7 @@ //#if (MultiOrgAuth) // "TenantId": "common", //#elseif (SingleOrgAuth) -// "Domain": "yourDomain", +// "Domain": "qualified.domain.name", // "TenantId": "22222222-2222-2222-2222-222222222222", //#endif // "ClientId": "11111111-1111-1111-11111111111111111", diff --git a/ProjectTemplates/templates/WebApi-CSharp/.template.config/template.json b/ProjectTemplates/templates/WebApi-CSharp/.template.config/template.json index 5cd70fbe8..52af7658a 100644 --- a/ProjectTemplates/templates/WebApi-CSharp/.template.config/template.json +++ b/ProjectTemplates/templates/WebApi-CSharp/.template.config/template.json @@ -68,8 +68,8 @@ "AAdB2CInstance": { "type": "parameter", "datatype": "string", - "defaultValue": "https://yourDomain.b2clogin.com/", - "replaces": "https:////yourDomain.b2clogin.com/", + "defaultValue": "https://qualified.domain.name.b2clogin.com/", + "replaces": "https:////qualified.domain.name.b2clogin.com/", "description": "The Azure Active Directory B2C instance to connect to (use with IndividualB2C auth)." }, "SignUpSignInPolicyId": { @@ -95,7 +95,7 @@ "Domain": { "type": "parameter", "datatype": "string", - "replaces": "yourDomain", + "replaces": "qualified.domain.namen", "description": "The domain for the directory tenant (use with SingleOrg or IndividualB2C auth)." }, "DefaultScope": { diff --git a/ProjectTemplates/templates/WebApi-CSharp/appsettings.json b/ProjectTemplates/templates/WebApi-CSharp/appsettings.json index 9819a5d75..7c2f7a5f0 100644 --- a/ProjectTemplates/templates/WebApi-CSharp/appsettings.json +++ b/ProjectTemplates/templates/WebApi-CSharp/appsettings.json @@ -1,7 +1,7 @@ { ////#if (IndividualB2CAuth) // "AzureAdB2C": { -// "Instance": "https:////yourDomain.b2clogin.com/", +// "Instance": "https:////qualified.domain.name.b2clogin.com/", // "ClientId": "11111111-1111-1111-11111111111111111", // "Domain": "qualified.domain.name", //#if (GenerateApi) diff --git a/ProjectTemplates/templates/Worker-CSharp/.template.config/template.json b/ProjectTemplates/templates/Worker-CSharp/.template.config/template.json index a27e13529..cefeda09c 100644 --- a/ProjectTemplates/templates/Worker-CSharp/.template.config/template.json +++ b/ProjectTemplates/templates/Worker-CSharp/.template.config/template.json @@ -58,8 +58,8 @@ "AAdB2CInstance": { "type": "parameter", "datatype": "string", - "defaultValue": "https://yourDomain.b2clogin.com/", - "replaces": "https:////yourDomain.b2clogin.com/", + "defaultValue": "https://qualified.domain.name.b2clogin.com/", + "replaces": "https:////qualified.domain.name.b2clogin.com/", "description": "The Azure Active Directory B2C instance to connect to (use with IndividualB2C auth)." }, "SignUpSignInPolicyId": { @@ -85,7 +85,7 @@ "Domain": { "type": "parameter", "datatype": "string", - "replaces": "yourDomain", + "replaces": "qualified.domain.name", "description": "The domain for the directory tenant (use with SingleOrg or IndividualB2C auth)." }, "DefaultScope": { diff --git a/ProjectTemplates/templates/Worker-CSharp/appsettings.json b/ProjectTemplates/templates/Worker-CSharp/appsettings.json index c9a278dc0..8d5f8a45c 100644 --- a/ProjectTemplates/templates/Worker-CSharp/appsettings.json +++ b/ProjectTemplates/templates/Worker-CSharp/appsettings.json @@ -1,54 +1,54 @@ { - ////#if (IndividualB2CAuth) - // "AzureAdB2C": { - // "Instance": "https:////yourDomain.b2clogin.com/", - // "ClientId": "11111111-1111-1111-11111111111111111", - // "Domain": "yourDomain.onmicrosoft.com", - //#if (GenerateApi) - // "ClientSecret": "secret-from-app-registration", - // "ClientCertificates" : [ - // ], - //#endif - // "SignUpSignInPolicyId": "MySignUpSignInPolicyId" - // }, - ////#elseif (OrganizationalAuth) - // "AzureAd": { - // "Instance": "https:////login.microsoftonline.com/", - //#if (!SingleOrgAuth) - // "TenantId": "common", - //#else - // "Domain": "yourDomain", - // "TenantId": "22222222-2222-2222-2222-222222222222", - //#endif - // "ClientId": "11111111-1111-1111-11111111111111111", +////#if (IndividualB2CAuth) +// "AzureAdB2C": { +// "Instance": "https:////qualified.domain.name.b2clogin.com/", +// "ClientId": "11111111-1111-1111-11111111111111111", +// "Domain": "qualified.domain.name", +//#if (GenerateApi) +// "ClientSecret": "secret-from-app-registration", +// "ClientCertificates" : [ +// ], +//#endif +// "SignUpSignInPolicyId": "MySignUpSignInPolicyId" +// }, +////#elseif (OrganizationalAuth) +// "AzureAd": { +// "Instance": "https:////login.microsoftonline.com/", +//#if (!SingleOrgAuth) +// "TenantId": "common", +//#else +// "Domain": "qualified.domain.name", +// "TenantId": "22222222-2222-2222-2222-222222222222", +//#endif +// "ClientId": "11111111-1111-1111-11111111111111111", - //#if (GenerateApiOrGraph) - // "ClientSecret": "secret-from-app-registration", - // "ClientCertificates" : [ - // ], - //#endif - // "CallbackPath": "/signin-oidc" - // }, - ////#endif - ////#if (GenerateApiOrGraph) - // "DownstreamApi": { - // /* - // 'Scopes' contains space separated scopes of the Web API you want to call. This can be: - // - a scope for a V2 application (for instance api://b3682cc7-8b30-4bd2-aaba-080c6bf0fd31/access_as_user) - // - a scope corresponding to a V1 application (for instance /.default, where is the - // App ID URI of a legacy v1 Web application - // Applications are registered in the https://portal.azure.com portal. - // */ - // "BaseUrl": "[WebApiUrl]", - // "Scopes": "user.read" - // }, - ////#endif - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "AllowedHosts": "*" +//#if (GenerateApiOrGraph) +// "ClientSecret": "secret-from-app-registration", +// "ClientCertificates" : [ +// ], +//#endif +// "CallbackPath": "/signin-oidc" +// }, +////#endif +////#if (GenerateApiOrGraph) +// "DownstreamApi": { +// /* +// 'Scopes' contains space separated scopes of the Web API you want to call. This can be: +// - a scope for a V2 application (for instance api://b3682cc7-8b30-4bd2-aaba-080c6bf0fd31/access_as_user) +// - a scope corresponding to a V1 application (for instance /.default, where is the +// App ID URI of a legacy v1 Web application +// Applications are registered in the https://portal.azure.com portal. +// */ +// "BaseUrl": "[WebApiUrl]", +// "Scopes": "user.read" +// }, +////#endif +"Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } +}, +"AllowedHosts": "*" }