Copied to clipboard

Flag this post as spam?

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


  • Bjorn Isaksen 3 posts 72 karma points
    Feb 17, 2021 @ 13:29
    Bjorn Isaksen
    0

    Owin account linking - broken profile view?

    Setting up a brand new umbraco site running 8.11.1.

    Installing UmbracoCms.IdentityExtensions.Google and confiure in according to documentation.

    The login with google button appears and the login actually works. But in the backoffice, the profile shown when clicking the user icon top right is broken.

    This means no other accounts can be linked, since the linkbutton, logout etc is not there.

    I also tried with adsf instead of google and same result. Anyone know whats going on?

    enter image description here

  • Alasdair 4 posts 74 karma points
    Aug 23, 2021 @ 01:17
    Alasdair
    0

    Did you ever figure this out? Having the same issue.

  • Alasdair 4 posts 74 karma points
    Aug 23, 2021 @ 02:28
    Alasdair
    1

    I figured it out!

    Checking the console I found:

    TypeError: Cannot read property 'AllowManualLinking' of undefined
    

    Which led me to this issue.

    I amended ~/App_Start/UmbracoGoogleAuthExtensions.cs

    public static void ConfigureBackOfficeGoogleAuth(this IAppBuilder app, string clientId, string clientSecret,
            string caption = "Google", string style = "btn-google", string icon = "fa-google")
        {
            var googleOptions = new GoogleOAuth2AuthenticationOptions
            {
                ClientId = clientId,
                ClientSecret = clientSecret, 
                //In order to allow using different google providers on the front-end vs the back office,
                // these settings are very important to make them distinguished from one another.
                SignInAsAuthenticationType = Constants.Security.BackOfficeExternalAuthenticationType,
                //  By default this is '/signin-google', you will need to change that default value in your
                //  Google developer settings for your web-app in the "REDIRECT URIS" setting
                CallbackPath = new PathString("/umbraco-google-signin")
            };
            googleOptions.ForUmbracoBackOffice(style, icon);
            googleOptions.Caption = caption;
    
            var autoLinkOptions = new ExternalSignInAutoLinkOptions(true);  // autoLinkExternalAccount = true
            autoLinkOptions.AllowManualLinking = true;
    
            googleOptions.SetBackOfficeExternalLoginProviderOptions(new BackOfficeExternalLoginProviderOptions
            {
                AutoRedirectLoginToExternalProvider = false,
                DenyLocalLogin = false, // if ANY external provider has this property set, local login will be disabled
                AutoLinkOptions = autoLinkOptions,
            });
    
            app.UseGoogleAuthentication(googleOptions);
        }
    

    and it all works as exepcted.

  • Petr 14 posts 44 karma points
    Jan 06, 2022 @ 13:49
    Petr
    0

    Great work. You saved my week ;-)

  • Corné Hoskam 80 posts 587 karma points MVP 2x c-trib
    Jan 31, 2022 @ 10:54
    Corné Hoskam
    0

    Much appreciated for both sharing this option & sharing the link to the issue using the Azure AD provider, that's what resolved my issue! đŸ˜„

  • Ben Dickman 19 posts 101 karma points
    Jul 14, 2022 @ 10:32
    Ben Dickman
    0

    Thanks for these details, saved me a lot of time!

Please Sign in or register to post replies

Write your reply to:

Draft