From 1511e3163d049417b6ec3250f337397d4e42649d Mon Sep 17 00:00:00 2001 From: Jesper Madsen <32263802+jesp209i@users.noreply.github.com> Date: Mon, 23 Jun 2025 15:01:32 +0200 Subject: [PATCH 1/6] Update public-access.md --- umbraco-cloud/set-up/project-settings/public-access.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/umbraco-cloud/set-up/project-settings/public-access.md b/umbraco-cloud/set-up/project-settings/public-access.md index 1a8fcdbb7de..fd5c9b9f53e 100644 --- a/umbraco-cloud/set-up/project-settings/public-access.md +++ b/umbraco-cloud/set-up/project-settings/public-access.md @@ -36,3 +36,9 @@ By default, **Basic Authentication** is enabled on trial projects. ![Allow IPs for your Umbraco Cloud Project](../images/allow_ip.png) Once **Basic Authentication** has been enabled, users not on the project or with IPs not added to the allowlist will be prompted to log in. + +### CMS Basic Authentication + +The Umbraco Cloud Public Access feature is built on top of the Basic Authentication implementation in CMS core. This means the appsettings related to Basic Authentication are controlled by Umbraco Cloud, but your Cloud Environment has access to them. With that you can setup a httpclient that can do a loop back request without being blocked, by adding the Shared Secret Header if needed. + +[CMS Basic Authentication Settings](https://docs.umbraco.com/umbraco-cms/reference/configuration/basicauthsettings) From 145b793243b24765fb8fbe8ae6685d586c494a70 Mon Sep 17 00:00:00 2001 From: Jesper Madsen <32263802+jesp209i@users.noreply.github.com> Date: Mon, 23 Jun 2025 15:15:05 +0200 Subject: [PATCH 2/6] Update public-access.md --- umbraco-cloud/set-up/project-settings/public-access.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/umbraco-cloud/set-up/project-settings/public-access.md b/umbraco-cloud/set-up/project-settings/public-access.md index fd5c9b9f53e..13db57d51dd 100644 --- a/umbraco-cloud/set-up/project-settings/public-access.md +++ b/umbraco-cloud/set-up/project-settings/public-access.md @@ -39,6 +39,8 @@ Once **Basic Authentication** has been enabled, users not on the project or with ### CMS Basic Authentication -The Umbraco Cloud Public Access feature is built on top of the Basic Authentication implementation in CMS core. This means the appsettings related to Basic Authentication are controlled by Umbraco Cloud, but your Cloud Environment has access to them. With that you can setup a httpclient that can do a loop back request without being blocked, by adding the Shared Secret Header if needed. +The Umbraco Cloud Public Access feature is built on top of the Basic Authentication implementation in CMS core. This means the appsettings related to Basic Authentication are controlled by Umbraco Cloud, and your Cloud Environment has access to them. With that you can setup a httpclient that can do a loop back request without being blocked, by adding the Shared Secret Header if needed. + +- [CMS Configuration: Reading Configuration in Code](https://docs.umbraco.com/umbraco-cms/reference/configuration#reading-configuration-in-code) +- [CMS Configuration Options: Basic Authentication Settings](https://docs.umbraco.com/umbraco-cms/reference/configuration/basicauthsettings) -[CMS Basic Authentication Settings](https://docs.umbraco.com/umbraco-cms/reference/configuration/basicauthsettings) From 2e1957d19a91c07eee3018691608305d8fa984e2 Mon Sep 17 00:00:00 2001 From: Jesper Madsen <32263802+jesp209i@users.noreply.github.com> Date: Tue, 24 Jun 2025 12:37:00 +0200 Subject: [PATCH 3/6] Add code example --- .../set-up/project-settings/public-access.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/umbraco-cloud/set-up/project-settings/public-access.md b/umbraco-cloud/set-up/project-settings/public-access.md index 13db57d51dd..461f44aee73 100644 --- a/umbraco-cloud/set-up/project-settings/public-access.md +++ b/umbraco-cloud/set-up/project-settings/public-access.md @@ -41,6 +41,17 @@ Once **Basic Authentication** has been enabled, users not on the project or with The Umbraco Cloud Public Access feature is built on top of the Basic Authentication implementation in CMS core. This means the appsettings related to Basic Authentication are controlled by Umbraco Cloud, and your Cloud Environment has access to them. With that you can setup a httpclient that can do a loop back request without being blocked, by adding the Shared Secret Header if needed. +```csharp +// Setup http client that does loop back requests +var basicAuthEnabled = Environment.GetEnvironmentVariable("UMBRACO__CMS__BASICAUTH__ENABLED") == "True"; +if (basicAuthEnabled) { + var headerName = Environment.GetEnvironmentVariable("UMBRACO__CMS__BASICAUTH__SHAREDSECRET__HEADERNAME"); + var headerValue = Environment.GetEnvironmentVariable("UMBRACO__CMS__BASICAUTH__SHAREDSECRET__VALUE"); + + loopbackHttpClient.DefaultRequestHeaders.Add(headerName, headerValue)); +} +``` + - [CMS Configuration: Reading Configuration in Code](https://docs.umbraco.com/umbraco-cms/reference/configuration#reading-configuration-in-code) - [CMS Configuration Options: Basic Authentication Settings](https://docs.umbraco.com/umbraco-cms/reference/configuration/basicauthsettings) From 6f656c62d427f2917d32d4082ec10d58fb43c5d1 Mon Sep 17 00:00:00 2001 From: Esha Noronha <82437098+eshanrnh@users.noreply.github.com> Date: Wed, 25 Jun 2025 09:35:16 +0200 Subject: [PATCH 4/6] Update umbraco-cloud/set-up/project-settings/public-access.md --- umbraco-cloud/set-up/project-settings/public-access.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/umbraco-cloud/set-up/project-settings/public-access.md b/umbraco-cloud/set-up/project-settings/public-access.md index 461f44aee73..471fed2003e 100644 --- a/umbraco-cloud/set-up/project-settings/public-access.md +++ b/umbraco-cloud/set-up/project-settings/public-access.md @@ -39,7 +39,9 @@ Once **Basic Authentication** has been enabled, users not on the project or with ### CMS Basic Authentication -The Umbraco Cloud Public Access feature is built on top of the Basic Authentication implementation in CMS core. This means the appsettings related to Basic Authentication are controlled by Umbraco Cloud, and your Cloud Environment has access to them. With that you can setup a httpclient that can do a loop back request without being blocked, by adding the Shared Secret Header if needed. +The **Public Access** feature in Umbraco Cloud is built on top of the **Basic Authentication** implementation in CMS core. This means the `appsettings` related to Basic Authentication are controlled by Umbraco Cloud, and your Cloud Environment has access to them. + +This setup allows you to configure an `HttpClient` that can do a loop back request without being blocked, by adding the **Shared Secret** Header if needed. ```csharp // Setup http client that does loop back requests From 24466471fec71ed5aed945c77e221f45b72b120c Mon Sep 17 00:00:00 2001 From: Esha Noronha <82437098+eshanrnh@users.noreply.github.com> Date: Wed, 25 Jun 2025 09:35:22 +0200 Subject: [PATCH 5/6] Update umbraco-cloud/set-up/project-settings/public-access.md --- umbraco-cloud/set-up/project-settings/public-access.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/umbraco-cloud/set-up/project-settings/public-access.md b/umbraco-cloud/set-up/project-settings/public-access.md index 471fed2003e..d6996ffba8e 100644 --- a/umbraco-cloud/set-up/project-settings/public-access.md +++ b/umbraco-cloud/set-up/project-settings/public-access.md @@ -54,6 +54,8 @@ if (basicAuthEnabled) { } ``` +For more information, see the following links: + - [CMS Configuration: Reading Configuration in Code](https://docs.umbraco.com/umbraco-cms/reference/configuration#reading-configuration-in-code) - [CMS Configuration Options: Basic Authentication Settings](https://docs.umbraco.com/umbraco-cms/reference/configuration/basicauthsettings) From 416da37314934cb88cc11d65fbd6b921e3d55085 Mon Sep 17 00:00:00 2001 From: Esha Noronha <82437098+eshanrnh@users.noreply.github.com> Date: Wed, 25 Jun 2025 09:37:09 +0200 Subject: [PATCH 6/6] Update umbraco-cloud/set-up/project-settings/public-access.md --- umbraco-cloud/set-up/project-settings/public-access.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/umbraco-cloud/set-up/project-settings/public-access.md b/umbraco-cloud/set-up/project-settings/public-access.md index d6996ffba8e..f775885eb68 100644 --- a/umbraco-cloud/set-up/project-settings/public-access.md +++ b/umbraco-cloud/set-up/project-settings/public-access.md @@ -39,7 +39,7 @@ Once **Basic Authentication** has been enabled, users not on the project or with ### CMS Basic Authentication -The **Public Access** feature in Umbraco Cloud is built on top of the **Basic Authentication** implementation in CMS core. This means the `appsettings` related to Basic Authentication are controlled by Umbraco Cloud, and your Cloud Environment has access to them. +The **Public Access** feature in Umbraco Cloud is built on top of the **Basic Authentication** implementation in CMS core. This means that the `appsettings` related to Basic Authentication are controlled by Umbraco Cloud, and your Cloud Environment has access to them. This setup allows you to configure an `HttpClient` that can do a loop back request without being blocked, by adding the **Shared Secret** Header if needed.