Why Headless CMS with Umbraco & .NET is the Future of Scalable Platforms
In this article, I’ll break down why moving to a headless CMS architecture using Umbraco and .NET can significantly improve performance, flexibility, and scalability.
In today's digital landscape, securing sensitive data is of paramount importance. For content management systems (CMS) like Umbraco, safeguarding the backoffice is crucial to prevent unauthorized access and potential data breaches. One effective way to enhance security is by implementing Google authentication for backoffice users. In this article, we'll guide you through the process of setting up Google authentication for your Umbraco CMS, providing an additional layer of protection and streamlining the login process.
Why Use Google Authentication? Google authentication, also known as OAuth or OpenID Connect, is a widely adopted standard for user authentication. It allows users to log in to your Umbraco backoffice using their Google account credentials. By leveraging Google's robust authentication infrastructure, you can minimize the risk of password-related security breaches. Additionally, Google authentication simplifies the login process, offering a seamless user experience.
Watch this video, you will get an idea of how to integrate Google Authentication.
Prerequisites: Before proceeding with the setup, ensure you have the following:
Step 1: Create a Google Developer Project:
Step 2: Configure Umbraco for Google Authentication:
public class GoogleBackOfficeExternalLoginProviderOptions : IConfigureNamedOptions
{
public const string SchemeName = GoogleDefaults.AuthenticationScheme;
public void Configure(string name, BackOfficeExternalLoginProviderOptions options)
{
if (name != Constants.Security.BackOfficeExternalAuthenticationTypePrefix + SchemeName)
{
return;
}
Configure(options);
}
public void Configure(BackOfficeExternalLoginProviderOptions options)
{
// Customize the login button
options.ButtonStyle = "btn-danger";
options.Icon = "fa fa-google";
// The following options are only relevant if you
// want to configure auto-linking on the authentication.
options.AutoLinkOptions = new ExternalSignInAutoLinkOptions(
// Set to true to enable auto-linking
autoLinkExternalAccount: true,
// [OPTIONAL]
// Default: "Editor"
// Specify User Group.
defaultUserGroups: new[] { Constants.Security.EditorGroupAlias },
// [OPTIONAL]
// Default: The culture specified in appsettings.json.
// Specify the default culture to create the User as.
// It can be dynamically assigned in the OnAutoLinking callback.
defaultCulture: null,
// [OPTIONAL]
// Enable the ability to link/unlink manually from within
// the Umbraco backoffice.
// Set this to false if you don't want the user to unlink
// from this external login provider.
allowManualLinking: true
)
{
// [OPTIONAL] Callback
OnAutoLinking = (autoLinkUser, loginInfo) =>
{
// Customize the user before it's linked.
// Modify the User's groups based on the Claims returned
// in the external ogin info.
var extClaim = loginInfo.Principal.Claims;
foreach (var claim in extClaim)
{
autoLinkUser.Claims.Add(new IdentityUserClaim
{
ClaimType = claim.Type,
ClaimValue = claim.Value,
UserId = autoLinkUser.Id
});
}
autoLinkUser.IsApproved = true;
},
OnExternalLogin = (user, loginInfo) =>
{
// Customize the User before it is saved whenever they have
// logged in with the external provider.
// Sync the Users name based on the Claims returned
// in the external login info
// Returns a boolean indicating if sign-in should continue or not.
var extClaim = loginInfo.Principal.Claims;
foreach (var claim in extClaim)
{
user.Claims.Add(new IdentityUserClaim
{
ClaimType = claim.Type,
ClaimValue = claim.Value,
UserId = user.Id
});
}
user.IsApproved = true;
return true;
}
};
// [OPTIONAL]
// Disable the ability for users to login with a username/password.
// If set to true, it will disable username/password login
// even if there are other external login providers installed.
options.DenyLocalLogin = true;
// [OPTIONAL]
// Choose to automatically redirect to the external login provider
// effectively removing the login button.
options.AutoRedirectLoginToExternalProvider = false;
}
}
public static IUmbracoBuilder AddGoogleAuthentication(this IUmbracoBuilder builder)
{
// Register ProviderBackOfficeExternalLoginProviderOptions here rather than require it in startup
builder.Services.ConfigureOptions();
builder.AddBackOfficeExternalLogins(logins =>
{
logins.AddBackOfficeLogin(
backOfficeAuthenticationBuilder =>
{
backOfficeAuthenticationBuilder.AddGoogle(
// The scheme must be set with this method to work for the back office
backOfficeAuthenticationBuilder.SchemeForBackOffice(GoogleBackOfficeExternalLoginProviderOptions.SchemeName),
options =>
{
// Callback path: Represents the URL to which the browser should be redirected to.
// The default value is '/signin-google'.
// The value here should match what you have configured in you external login provider.
// The value needs to be unique.
options.CallbackPath = "/umbraco-google-signin";
options.ClientId = "{ClientId}"; // Replace with your client id generated while creating OAuth client ID
options.ClientSecret = "{ClientSecret}"; // Replace with your client secret generated while creating OAuth client ID
});
});
});
return builder;
}
public void ConfigureServices(IServiceCollection services)
{
services.AddUmbraco(_env, _config)
.AddBackOffice()
.AddWebsite()
.AddDeliveryApi()
.AddComposers()
.AddGoogleAuthentication()
.Build();
}
Step 3: Test the Google Authentication:
Conclusion: By implementing Google authentication for your Umbraco CMS backoffice, you can significantly enhance security while providing a more user-friendly login experience for your users. The process involves creating a Google Developer project, configuring Umbraco, and enabling the OAuth 2.0 client. With this additional layer of protection, you can rest assured that your backoffice data remains secure and accessible only to authorized personnel. Stay vigilant and regularly update your security measures to stay one step ahead of potential threats. Happy content managing
In this article, I’ll break down why moving to a headless CMS architecture using Umbraco and .NET can significantly improve performance, flexibility, and scalability.
Umbraco 16, released on June 12, 2025, is the latest major version of the open-source .NET content management system (CMS) known for its flexibility and user-friendly interface. Building on the modernized backoffice introduced in Umbraco 14 and refined in Umbraco 15, this short-term support (STS) release brings incremental yet impactful improvements for content editors, developers, and marketers. In this blog, we’ll explore the key features of Umbraco 16, how they enhance your website-building experience, and why upgrading is worth considering for your personal site.
Umbraco 14 is a significant release that introduces several new features and changes aimed at improving the overall user experience, developer productivity, and extensibility of the CMS. Here are some of the key features and changes: