Skip to content

Cloud Public Access additional information #7184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions umbraco-cloud/set-up/project-settings/public-access.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,26 @@ 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 **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.

```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));
}
```

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)