Skip to content

Commit e9aca54

Browse files
committed
Remove problematic placeholder values for client secret
1 parent 4167875 commit e9aca54

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

api/Configurations/CustomServiceConfigurations.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ public static TokenCredential CreateCredential(IConfiguration config)
4747
string? clientId = config["AzureAd:ClientId"];
4848
string? clientSecret = config["AzureAd:ClientSecret"];
4949

50+
if (string.IsNullOrWhiteSpace(tenantId))
51+
tenantId = null;
52+
if (string.IsNullOrWhiteSpace(clientId))
53+
clientId = null;
54+
if (string.IsNullOrWhiteSpace(clientSecret))
55+
clientSecret = null;
56+
5057
tenantId ??= config["AZURE_TENANT_ID"];
5158
clientId ??= config["AZURE_CLIENT_ID"];
5259
clientSecret ??= config["AZURE_CLIENT_SECRET"];
@@ -146,6 +153,13 @@ public static TokenCredential CreateRuntimeCredential(IConfiguration config)
146153
string? clientId = config["AzureAd:ClientId"];
147154
string? clientSecret = config["AzureAd:ClientSecret"];
148155

156+
if (string.IsNullOrWhiteSpace(tenantId))
157+
tenantId = null;
158+
if (string.IsNullOrWhiteSpace(clientId))
159+
clientId = null;
160+
if (string.IsNullOrWhiteSpace(clientSecret))
161+
clientSecret = null;
162+
149163
tenantId ??= config["AZURE_TENANT_ID"];
150164
clientId ??= config["AZURE_CLIENT_ID"];
151165
clientSecret ??= config["AZURE_CLIENT_SECRET"];

api/appsettings.Development.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"AzureAd": {
33
"ClientId": "dd7e115a-037e-4846-99c4-07561158a9cd",
4-
"ClientSecret": "Fill in ASP.NET Secret Manager",
4+
"ClientSecret": "",
55
"AllowedAuthMethods": [ "ClientSecret", "WorkloadIdentity" ]
66
},
77
"Logging": {

api/appsettings.Production.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"AzureAd": {
33
"ClientId": "7d167947-b236-47ab-baa0-3d3575334237",
4-
"ClientSecret": "Fill in ASP.NET Secret Manager",
4+
"ClientSecret": "",
55
"AllowedAuthMethods": [ "ClientSecret", "WorkloadIdentity" ]
66
},
77
"Logging": {

api/appsettings.Staging.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"AzureAd": {
33
"ClientId": "47a40d36-25a0-434c-8de2-94f703fb57f4",
4-
"ClientSecret": "Fill in ASP.NET Secret Manager",
4+
"ClientSecret": "",
55
"AllowedAuthMethods": [ "ClientSecret", "WorkloadIdentity" ]
66
},
77
"Logging": {

0 commit comments

Comments
 (0)