I've created a two-factor page for sitecore login on older sitecore (9.0 and below) by playing with its LoggedInArgs like this:
- Check the condition if 2FA needed. If it is, then abort LoggedInArgs
loggedInArgs.AbortPipeline();
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);
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?