Public Access
In this article, we show how you can enable public access for your Umbraco Cloud project, so only people with whitelisted IPs can access your project.
Public Access lets you deny access to your Umbraco Cloud project.
When enabled only team members on the project and users whose IPs have been allowed, can access the frontend of the project.
All environments on Umbraco Cloud projects can be protected by Public access. It requires you to enter your Cloud credentials in order to view the frontend.
How to enable Basic Authentication and allow IPs
Go to Public Access in the project settings tab
Enable Basic Authentication on the project

Once enabled Add IPs for users that need access to the project

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.
// 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:
Last updated
Was this helpful?