Skip to content

Commit 2ae0ee6

Browse files
Svc: use windows auth by default unless overridden in config
1 parent 48e75ff commit 2ae0ee6

File tree

1 file changed

+19
-3
lines changed
  • src/Certify.Server/Certify.Server.Core/Certify.Server.Core

1 file changed

+19
-3
lines changed

src/Certify.Server/Certify.Server.Core/Certify.Server.Core/Startup.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,27 @@ private bool DetermineWindowsAuthRequired()
240240
{
241241
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
242242
{
243-
return Environment.GetEnvironmentVariable("CERTIFY_SERVICE_AUTH_MODE") != "none" &&
244-
Configuration["Service:AuthMode"] != "none";
243+
if (
244+
Environment.GetEnvironmentVariable("CERTIFY_SERVICE_AUTH_MODE") == "none"
245+
|| Configuration["Service:AuthMode"] == "none"
246+
)
247+
{
248+
// env or config set to "none", use Service Auth Policy instead
249+
return false;
250+
}
251+
else
252+
{
253+
// use Windows auth by default
254+
return true;
255+
}
245256
}
257+
else
258+
{
259+
// not windows, use service auth policy
260+
return false;
261+
}
262+
246263

247-
return false;
248264
}
249265
}
250266
}

0 commit comments

Comments
 (0)