Copied to clipboard

Flag this post as spam?

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


  • Chris Mahoney 233 posts 445 karma points
    Feb 02, 2023 @ 00:25
    Chris Mahoney
    0

    Automatic Active Directory login?

    Hi everyone,

    I'm running on 10.4 and have implemented Active Directory authentication as discussed over on https://github.com/umbraco/Umbraco-CMS/issues/13100. When a user goes to /umbraco they get the login page with a "Sign in with Microsoft" link, along with the "legacy" email/password fields.

    Is it possible to skip this page entirely, and just act like they've clicked on Sign in with Microsoft? Some users are trying to enter their AD credentials into the other fields, which obviously doesn't work. It would simplify things if we could bypass this whole page.

    Is that possible?

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Feb 02, 2023 @ 07:33
    Dave Woestenborghs
    100

    Hi Chris,

    I think you will need to set some extra settings in your code.

    See https://docs.umbraco.com/umbraco-cms/reference/security/auto-linking

    From that docs page you will see there are two properties that you can change the login behavior.

       // Optionally you can disable the ability for users
                // to login with a username/password. If this is set
                // to true, it will disable username/password login
                // even if there are other external login providers installed.
                options.DenyLocalLogin = false;
    
                // Optionally choose to automatically redirect to the
                // external login provider so the user doesn't have
                // to click the login button. This is
                options.AutoRedirectLoginToExternalProvider = false;
    

    Changing the last one to true should give you the behavior you are looking for.

    Dave

  • Chris Mahoney 233 posts 445 karma points
    Feb 02, 2023 @ 19:08
    Chris Mahoney
    0

    Thanks. My accounts are all already linked so I didn't look at that "auto linking" page.

    Edit: Wow, I must've been sleepy yesterday... those two lines are already in my .cs file and just needed to be changed to true! Thanks again.

Please Sign in or register to post replies

Write your reply to:

Draft