Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Matt Tolliday 11 posts 31 karma points
    Jan 17, 2022 @ 13:52
    Matt Tolliday

    Umbraco 9 - How to not require unique emails and logins in membership?

    Hi all,

    I've had a requirement in that we need to have unique members across a multi-site Umbraco instance of two sites. There is a strong chance that members will want to sign up to both sites independently - which will require we support the same emails.

    In Umbraco 8 I can see that this was overridable by using the web.config setting requireUniqueEmail=false.

    In Umbraco 9, It feels like this wont be possible as the MemberController PostSave method is decorated with MemberSaveValidationAttribute which does not allow for this, nor take into account the ASP Core Identity configuration for it:

                .Configure<IdentityOptions>(options =>
                    options.User.RequireUniqueEmail = false;

    The only configuration options now baked in appear to be:

    In this example, semi-unrelated, I cant see any extension points that would help:

    This appears to be a very Umbraco 8 only idea:

    Does anyone have any ideas how we could achieve this?


    Edit 1:

    Looks like the Umbraco installation sets its own defaults for the IdentityOptions, but overriding AFTER the configure Umbraco in Startup.cs works to disable the require setting to false (RequireUniqueEmail) - however this then falls back to the back-office requiring the use of the mandated validation via MemberSaveValidationAttribute - any way to disable this?

                .AddUmbraco(_env, _config)
                .Configure<IdentityOptions>(options =>
                    options.User.RequireUniqueEmail = false;

    enter image description here

  • Alexandre Locas 52 posts 217 karma points
    Aug 17, 2022 @ 14:14
    Alexandre Locas

    Hi Matt, I have the same requirements, did you find a solution ?

    Thank you

  • P.J. Melies 18 posts 108 karma points
    Oct 06, 2023 @ 23:58
    P.J. Melies

    This is still a problem in v10. Has anyone found a reasonable workaround for this issue?

  • Steve 9 posts 78 karma points c-trib
    Oct 07, 2023 @ 03:01

    Looking at this myself rn having upgraded a v7 site to v10 recently and spotted the same issue.

    Just knocked up an interceptor to prefix the email address with an underscore which circumvents the duplicate email validation:

    angular.module("").config(["$httpProvider", function ($httpProvider) {
        $httpProvider.interceptors.push(function ($q) {
            return {
                'request': function (request) {
                    if (request.url.startsWith('/umbraco/backoffice/umbracoapi/member/PostSave')) {
               = '_' +;
                    return request || $q.when(request);

    The underscore then gets trimmed off in a member saving notification handler:

    using Umbraco.Cms.Core.Events;
    using Umbraco.Cms.Core.Notifications;
    public class MemberSavingNotificationHandler : INotificationHandler<MemberSavingNotification>
        private readonly HttpContext httpContext;
        public MemberSavingNotificationHandler(IHttpContextAccessor httpContextAccessor)
            => this.httpContext = httpContextAccessor.GetRequiredHttpContext();
        public void Handle(MemberSavingNotification notification)
            if (this.httpContext?.Request.Path.ToString() is not string url || !url.StartsWith("/umbraco", StringComparison.OrdinalIgnoreCase))
            foreach (var member in notification.SavedEntities)
                member.Email = member.Email.TrimStart("_");

    You'll need to be careful if you are checking if the email is dirty as now it always will be; you'd need to load the old version and compare old email vs new.

    Not tested this thoroughly yet or stopped to ponder side effects so use at your own risk!

Please Sign in or register to post replies

Write your reply to: