0

I've created a two-factor page for sitecore login on older sitecore (9.0 and below) by playing with its LoggedInArgs like this:

  1. Check the condition if 2FA needed. If it is, then abort LoggedInArgs

loggedInArgs.AbortPipeline();

  1. On 2FA page the user will enter their code then proceed to login by creating new LoggedInArgs using username and starturl gathered by first step

    LoggedInArgs loggedInArgs = new LoggedInArgs()
    {
        Username = userName,
        StartUrl = startUrl
    };
    Pipeline.Start("loggedin", loggedInArgs);
    
  2. Then Sitecore will login accordingly

But on Sitecore 9.1 we are using IdentityServer and using new args which is SignedInArgs. I can't create the args manually since it needs CookieResponseSignedInContext from (I guess) Owin on IdentityServer.

LoggedInArgs is deprecated but still usable until Sitecore 9.2 which will delete all deprecated codes.

Is there any way to do it? or some workarounds?

2
  • Are you intending on providing your own 2FA service? Or are you integrating with a federated authentication service like Azure AD or similar?
    – Richard Seal
    Commented Feb 10, 2020 at 13:32
  • @RichardSeal yea. This is my custom 2fa using totp
    – purnadika
    Commented Feb 10, 2020 at 13:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.