Copied to clipboard

Flag this post as spam?

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


  • AnandBhopale 54 posts 172 karma points
    May 07, 2021 @ 16:45
    AnandBhopale
    0

    unable to combine Front-end and Back-end Authenticator

    Hi,

    I am integrating my Umbraco Site with Azure Active Directory.

    for backend login, I am using following link

    https://shazwazza.com/post/configuring-azure-active-directory-login-with-umbraco/

    for member login, I am using following link

    https://shazwazza.com/post/configuring-azure-active-directory-login-with-umbraco-members/

    Both these solutions are great and working perfectly in two different project.

    Now, I want to combine them in one project and have one start up class (say UmbracoIdentityStartup instead of UmbracoStandardOwinStartup)

    This works only for front-end login

    Then I have combined the code to have in UmbracoADAuthExtensions.cs like

     public class UmbracoIdentityOwinStartup : UmbracoIdentityOwinStartupBase
    {
        readonly string TenantID = ConfigurationManager.AppSettings["azureAd:tenantId"];
        readonly string ClientID = ConfigurationManager.AppSettings["azureAd:clientId"];
        readonly string redirectUrl = ConfigurationManager.AppSettings["FrontEndRedirectUrl"];
        readonly string BackendredirectUrl = ConfigurationManager.AppSettings["BackEndRedirectUrl"];
        protected override void ConfigureUmbracoUserManager(IAppBuilder app)
        {
            UmbracoUserManager(app);
        //   This is additional line
            **app.ConfigureBackOfficeAzureActiveDirectoryAuth(TenantID, ClientID, BackendredirectUrl, new Guid(TenantID));**
    
        }
    

    Rest of Code is same.

    As result of combination,

    1. I am able to authenticate on Front end
    2. Back-end goes into infinite loop after login

    I need guidance from experts on how to solve this

  • Oscar 2 posts 72 karma points
    Nov 04, 2021 @ 10:35
    Oscar
    0

    Hello,

    I'm facing the same issue.

    Is there any way to merge both solutions and authenticate the frontend and the backoffice using Azure Active Directory?

    Any help would be much appreciated.

  • Oscar 2 posts 72 karma points
    Nov 08, 2021 @ 15:33
    Oscar
    0

    Finally I was able to solve the issue. In my case I was creating both providers with the same AuthenticationType.

    Once I changed one of the Authentication Types it worked.

    //Need to set the auth type as the issuer path
            adOptions.AuthenticationType = string.Format(
                System.Globalization.CultureInfo.InvariantCulture,
                "https://sts.windows.net/{0}/",
                new Guid());
    

    Hope this solution helps someone.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies