Copied to clipboard

Flag this post as spam?

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


  • Amalie Wowern 144 posts 273 karma points c-trib
    Sep 02, 2022 @ 10:19
    Amalie Wowern
    0

    Hi

    Is there any good documentation for setting up external login for backoffice with ADFS

    I have made this so far, but im getting an error

    Code enter image description here

     services.AddUmbraco(_env, _config)
                .AddBackOffice()
                .AddWebsite()
                .AddADFSBackofficeAuthentication()
                .AddComposers()
                .Build();
    

    Error

    InvalidOperationException: No authentication handler is registered for the scheme 'Umbraco.Microsoft'. The registered schemes are: UmbracoBackOffice, UmbracoExternalCookie, UmbracoTwoFactorCookie, UmbracoTwoFactorRememberMeCookie, Identity.Application, Identity.External, Identity.TwoFactorRememberMe, Identity.TwoFactorUserId, Umbraco.WsFederation, Cookies. Did you forget to call AddAuthentication().Add[SomeAuthHandler]("Umbraco.Microsoft",...)?
    
  • Damien Holley 179 posts 540 karma points
    May 04, 2023 @ 01:36
    Damien Holley
    0

    Possibly the 2 realm declarations are causing issues? (one is for AAD not ADFS), Also you should probably setup your own backoffice login provider options. I have used the below and it works using federation (ADFS)

     public static IUmbracoBuilder ConfigureWSFedAuthentication(this IUmbracoBuilder builder)
        {
            var config = new WSFederationConfig();
            builder.Config.GetSection("ADFS").Bind(config);
            builder.Services.ConfigureOptions<WSFEDBackOfficeExternalLoginProviderOptions>();
    
            builder.AddBackOfficeExternalLogins(logins =>
                logins.AddBackOfficeLogin(
                    backofficeBuilder =>
                        backofficeBuilder.AddWsFederation(
                            backofficeBuilder.SchemeForBackOffice(WSFEDBackOfficeExternalLoginProviderOptions.SchemeName) ?? string.Empty,
    
                            options => {
                                options.MetadataAddress = config.AdfsMetadataEndpoint;
                                options.Wtrealm = config.AdfsRelyingParty;
                                options.ReturnUrlParameter = config.AdfsReplyUrl;
                            })
                        )
                    );
    
            return builder;
        }
    
Please Sign in or register to post replies

Write your reply to:

Draft