Add auth header to PowerBI Endpoint

This commit is contained in:
Michał Zieliski
2024-06-06 15:28:12 +02:00
parent b0c39b8ec1
commit 5843149651
3 changed files with 9 additions and 0 deletions

View File

@@ -103,6 +103,13 @@ namespace WebAPI.Controllers
{
return Unauthorized();
}
if (
!Request.Headers.TryGetValue("D-BI-AUTH", out var authKey)
|| authKey != configuration["authKey"])
{
return Unauthorized();
}
try
{
return Ok(db.Layers

View File

@@ -13,6 +13,7 @@
"GoogleClientId": "107631825312-bkfe438ehr9k9ecb2h76g802tj6advma.apps.googleusercontent.com",
"Secret": "8393AF8EAEF8478CB738D44858690F9C7E2D19F65896DD9FBAA3EB2A6F493E80",
"apiKey": "10763478CB738D4ecb2h76g803478CB738D4e",
"authKey": "0F9C7E2D19FSLOCgKexz2h76g802tj6a",
"exportDirectory": "1eTyCUzYbzVQB8f8sbNmvnebFXyW2-axt",
"appLogsFile": "13PuDvS3_HAYoSLOCgKexzlzIDLUilkApUF8QiJMTae0",
"apiLocalUrl": "localhost:5400",

View File

@@ -13,6 +13,7 @@
"GoogleClientId": "#{google-backend-login-client-id}#",
"Secret": "#{google-backend-login-secret}#",
"apiKey": "#{api-key}#",
"authKey": "#{auth-key}#",
"exportDirectory": "#{export-directory}#",
"appLogsFile": "#{app-logs-file}#",
"apiLocalUrl": "#{api-local-url}#",